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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: vedro_unittest-0.0.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for vedro_unittest-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1913d7ad865f281d523c29a474fec40fc0c9e745b97326235d94255962ccaeff
MD5 41aa755e3ac91d62d1f33645a1269232
BLAKE2b-256 5996c647ff5246b3180777c60d7086ac8c0ec530b522081251840b50e0fa321a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vedro_unittest-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79978210d0f615f4767affe89068f26679baa830fc57cbdf64e28159d886bded
MD5 c45b446efe909bf1c2758c50cd9ad449
BLAKE2b-256 b3919e02b2ce3cd22e8f7e58e055baa053c86e73c6a823edb2d35e9964119ac0

See more details on using hashes here.

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