Testing Site Testing Site

skip to navigation
skip to content

testfunc 0.1

A sample tool for testing functions

## introduction
a simple parametrized test tool for function

## example
```python
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](screenshot.png)
 
File Type Py Version Uploaded on Size
testfunc-0.1.tar.gz (md5) Source 2017-12-07 3KB