Skip to main content

Allows running unittest test cases within the Vedro framework

Project description

Vedro Unittest

Codecov PyPI PyPI - Downloads Python Version

vedro-unittest allows running unittest test cases within the Vedro framework. This plugin seamlessly integrates unittest test cases, converting them into Vedro scenarios to leverage the powerful features of the Vedro testing framework.

Installation

Quick

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

$ vedro plugin install vedro-unittest

Manual

To install manually, follow these steps:

  1. Install the package using pip:
$ pip3 install vedro-unittest
  1. Next, activate the plugin in your vedro.cfg.py configuration file:
# ./vedro.cfg.py
import vedro
import vedro_unittest

class Config(vedro.Config):

    class Plugins(vedro.Config.Plugins):

        class VedroUnitTest(vedro_unittest.VedroUnitTest):
            enabled = True

Usage

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

# ./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:

$ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vedro_unittest-0.2.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vedro_unittest-0.2.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file vedro_unittest-0.2.0.tar.gz.

File metadata

  • Download URL: vedro_unittest-0.2.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for vedro_unittest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5282624ba6117541564fe2937b1d56958d2f33e71f17916ac77593d692bccd92
MD5 50e9a7e5897da708637fc5cb2301362f
BLAKE2b-256 20fe07050076c9da70b609f404ea2ee38702d6bf44b60f0cefaae9bdf61618bb

See more details on using hashes here.

File details

Details for the file vedro_unittest-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: vedro_unittest-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for vedro_unittest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 467b199ed2ba667c90fabee902ff315acd6f6121c267227eb6ca6afb7e356cde
MD5 8783d593fca451146102c907ef21d1a6
BLAKE2b-256 e48b12b0d24cd45595727d7dd0ea383f846bc3e5298d701420370396d7c94cfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page