Skip to main content

datadriven

datadriven allows you to run a test case multiple times with different data. It was designed to work with unittest.TestCase test methods, any test runner (nose, nose2, unittest, unittest2 and pytest), in Python 2.7 or 3.7+.

Usage

import datadriven

class SomeTestCase(unittest.TestCase):

    @datadriven.datadriven(
        caseA=datadriven.Args(first="foo"),
        caseB=datadriven.Args("hello", second="world"),
    )
    def test_method(self, first, second=None):
        ...

This is the equivalent of writing:

import datadriven

class SomeTestCase(unittest.TestCase):

    def test_method(self, first, second=None):
        ...

    def test_method_caseA(self):
        self.test_method("foo")

    def test_method_caseB(self):
        self.test_method("hello", "world")

The only difference is that when wrapped with @datadriven, the test test_method won't be really executed.

License

Apache-2.0 License

Metadata

Release files for datadriven 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datadriven 1.0.0
File Size Uploaded
datadriven-1.0.0.tar.gz 6.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for datadriven 1.0.0
File Interpreter ABI Platform
datadriven-1.0.0-py3-none-any.whl Python 3 none any Details
datadriven-1.0.0-py2-none-any.whl Python 2 none any Details

Total release size: 21.0 kB

Release files / datadriven-1.0.0.tar.gz

Download URL datadriven-1.0.0.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
df6d69c122e0e94dafe0544b1368c7396ccd1417fa96973b622c7e4f0fd77236
BLAKE2b-256 checksum
How to use checksums
6314f92ea21fc7af616a09e1b1f783ddf9b5fa1a7749ae5819cc822ef650977f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / datadriven-1.0.0-py3-none-any.whl

Download URL datadriven-1.0.0-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
796abff2973dc4692ee8736f6e619829b172078d188d74e0eea13a0978e8e596
BLAKE2b-256 checksum
How to use checksums
da4f61cc2287cc6aa3444e05a0b10bc5533ea9921c07665df32691053902e631
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release files / datadriven-1.0.0-py2-none-any.whl

Download URL datadriven-1.0.0-py2-none-any.whl
Size 7.0 kB
Tags Python 2
SHA-256 checksum
How to use checksums
a63c3c5a43b66f444bf408cfb99f9a38339bbb1625efe39233db258ac46ce3c9
BLAKE2b-256 checksum
How to use checksums
41d50750f8f3d9fd30cecfa72bd5eaaa47e6d876d5972c91dfbb869c223e967e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

3 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page