Metadata-Version: 2.4
Name: vedro-unittest
Version: 0.2.0
Summary: Allows running unittest test cases within the Vedro framework
Home-page: https://github.com/vedro-universe/vedro-unittest
Author: Nikita Tsvetkov
Author-email: tsv1@fastmail.com
License: Apache-2.0
Project-URL: Docs, https://vedro.io/docs/integrations/unittest-bridge
Project-URL: GitHub, https://github.com/vedro-universe/vedro-unittest
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: vedro<2.0,>=1.14
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Vedro Unittest

[![Codecov](https://img.shields.io/codecov/c/github/vedro-universe/vedro-unittest/main.svg?style=flat-square)](https://codecov.io/gh/vedro-universe/vedro-unittest)
[![PyPI](https://img.shields.io/pypi/v/vedro-unittest.svg?style=flat-square)](https://pypi.python.org/pypi/vedro-unittest/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/vedro-unittest?style=flat-square)](https://pypi.python.org/pypi/vedro-unittest/)
[![Python Version](https://img.shields.io/pypi/pyversions/vedro-unittest.svg?style=flat-square)](https://pypi.python.org/pypi/vedro-unittest/)

[vedro-unittest](https://pypi.org/project/vedro-unittest/) allows running unittest test cases within the [Vedro](https://vedro.io/) framework. This plugin seamlessly integrates unittest test cases, converting them into Vedro scenarios to leverage the powerful features of the Vedro testing framework.

## Installation

<details open>
<summary>Quick</summary>
<p>

For a quick installation, you can use a plugin manager as follows:

```shell
$ vedro plugin install vedro-unittest
```

</p>
</details>

<details>
<summary>Manual</summary>
<p>

To install manually, follow these steps:

1. Install the package using pip:

```shell
$ pip3 install vedro-unittest
```

2. Next, activate the plugin in your `vedro.cfg.py` configuration file:

```python
# ./vedro.cfg.py
import vedro
import vedro_unittest

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):

        class VedroUnitTest(vedro_unittest.VedroUnitTest):
            enabled = True
```

</p>
</details>

## Usage

To use the plugin, create your unittest test cases as usual:

```python
# ./scenarios/test_base64.py
import unittest
from base64 import b64encode, b64decode

class TestBase64Encoding(unittest.TestCase):
    def test_encode_to_base64(self):
        result = b64encode(b"banana")
        self.assertEqual(result, b"YmFuYW5h")

    def test_decode_from_base64(self):
        result = b64decode(b"YmFuYW5h")
        self.assertEqual(result, b"banana")
```

Then run your tests using Vedro:

```shell
$ vedro run tests/
```

This will automatically detect and run your unittest test cases as Vedro scenarios, allowing you to take advantage of Vedro's rich feature set.

**📘 Explore more:** Learn how to gradually migrate your test suite, understand compatibility and limitations, and unlock the full potential of Vedro in the [official unittest bridge documentation](https://vedro.io/docs/integrations/unittest-bridge).
