ward
ward copied to clipboard
Supporting Hypothesis tests
I'd like to re-examine this. It was an early goal of Ward that was dropped. It's actually the reason the @using
decorator exists!
Ideally we could write tests like:
@given(text())
@using(fix=some_fixture) # this already exists
@test("the test description")
def _(some_text, fix):
...
or perhaps the following, if possible...
@using(some_text=text(), fix=some_fixture)
@test("the test description")
def _(some_text, fix):
...
Examining the code here could be useful: https://github.com/HypothesisWorks/hypothesis/blob/master/hypothesis-python/src/hypothesis/extra/pytestplugin.py#L139
I would be keen on having this. I really like the way ward does parameterized testing and would like to combine that with hypothesis.
@darrenburns Are there any updates on this? I was thinking of using ward
and hypothesis
for testing one of my own packages, and saw that this issue is still open. It would be really nice to have support for this 😁 ! PS: The code for hypothesis
's pytest
plugin has moved here, if anyone wants to have a look at it.