A sample tool for testing functions
Project description
introduction
a simple parametrized test tool for function
example
from testfunc import test def foo(a=0, b=0): return a+b # test_data is a list of test cases # a test case is the form of (args, result) or (args, kw, result) # if args is a tuple it will be unpacked, if this is not desired, pass `unpack=False` to `test` test_data = [ ( (1, 2), 3 ), ( (1, 1), 3 ), ( (1,), 1 ), ( (), 0 ), ( 1, {'b':2}, 3 ) ] test(foo, test_data)
screenshot
check testfunc.py for more examples.
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size testfunc-0.1.tar.gz (3.6 kB) | File type Source | Python version None | Upload date | Hashes View |