Add Hypothesis for property-based tests

Hypothesis:
"It works by letting you write tests that assert that
something should be true for every case, not just the ones you happen to
think of."

I think it's well suited for the task of ensuring Daphne conforms to the
ASGI specification.
This commit is contained in:
Maik Hoepfel 2017-02-09 13:21:41 +01:00
parent 60952b34bf
commit c2baa32a9c
4 changed files with 7 additions and 1 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ __pycache__
dist/
build/
/.tox
.hypothesis
.cache

View File

@ -11,6 +11,6 @@ env:
- TWISTED_RELEASE="twisted"
- TWISTED_RELEASE="twisted==16.0.0"
install: pip install $TWISTED_RELEASE -e .
install: pip install $TWISTED_RELEASE -e .[tests]
script: python -m unittest discover

View File

@ -27,6 +27,9 @@ setup(
'twisted>=16.0',
'autobahn>=0.12',
],
extras_require={
'tests': ['hypothesis', 'tox']
},
entry_points={'console_scripts': [
'daphne = daphne.cli:CommandLineInterface.entrypoint',
]},

View File

@ -3,6 +3,7 @@
envlist = py{27,34,35}-twisted-{old,new}
[testenv]
extras = tests
deps =
twisted-old: twisted==16.0.0
commands = python -m unittest discover