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_banana_to_base64(self):
        result = b64encode(b"banana")
        self.assertEqual(result, b"YmFuYW5h")

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

Then run your tests using Vedro:

$ vedro run

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

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.0.1.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

vedro_unittest-0.0.1-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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