Skip to main content

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) :-)

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

dado-0.1.0-py2.py3-none-any.whl (4.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page