Run a test case multiple times with different data
Project description
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 the test test_method
won't actually be executed.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
datadriven-0.1.0.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for datadriven-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d287b98d656b822643f86106c9503739f84189730f4f37a3c469030a3a996db7 |
|
MD5 | 7883bd4b5657bd33804393e1246c10d6 |
|
BLAKE2b-256 | ea1293c6f958b038716b70f6136899d16519dfec0bfd9990580eef88a88c15e0 |