Dado: Data Driven Test Decorator.
Project description
# dado
Data-driven test decorator
# What
Decorate a test to create indepenent tests for each decorated data set.
# Example
Given:
```python
from dado import data_driven
@data_driven(['first', 'second'], {
'letters': ['a', 'b'],
'numbers': [0, 1],
})
def test_first_two(first, second): ...
```
When you load the module, it will load as if you'd defined:
```python
def test_first_two_letters():
return test_first_two('a', 'b')
def test_first_two_numbers():
return test_first_two(0, 1)
```
# Name
A 'dado' in woodworking is "a groove cut in the face of a board, into which the edge of another board is fixed."
This decorator lets you define a test function into which you fit test data to get the tests you actually want to run.
Plus, 'dado' is much easier to say and remember than 'data-driven-test-decorator', while still keeping some phonetic
similarity.
Naming credit goes to [soapko](https://github.com/soapko) :-)
Data-driven test decorator
# What
Decorate a test to create indepenent tests for each decorated data set.
# Example
Given:
```python
from dado import data_driven
@data_driven(['first', 'second'], {
'letters': ['a', 'b'],
'numbers': [0, 1],
})
def test_first_two(first, second): ...
```
When you load the module, it will load as if you'd defined:
```python
def test_first_two_letters():
return test_first_two('a', 'b')
def test_first_two_numbers():
return test_first_two(0, 1)
```
# Name
A 'dado' in woodworking is "a groove cut in the face of a board, into which the edge of another board is fixed."
This decorator lets you define a test function into which you fit test data to get the tests you actually want to run.
Plus, 'dado' is much easier to say and remember than 'data-driven-test-decorator', while still keeping some phonetic
similarity.
Naming credit goes to [soapko](https://github.com/soapko) :-)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file dado-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: dado-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac9eb7c58efb7582cd4bc2401d4fb7da8b220cf750e5728e42b665e3cc60924c |
|
MD5 | fe61ac1b243b085c60477acd5e86fe53 |
|
BLAKE2b-256 | 922e452e83e9e7d223396e3de07f213b3939cac44fc2619c8f43c178ea34b9cb |