4 ms·
Not sure if it's directly applicable to Hypothesis, but one way to use QuickCheck for interactive code is to define a type representing actions to take, eg.
by chriswarbo 11y ago
Not sure if it's directly applicable to Hypothesis, but one way to use QuickCheck for interactive code is to define a type representing actions to take, eg.
data Action = DoFoo | DoBar | DoSequence [Action] | DoParallel [Action]
We can then write an "run" function which executes these action, and use it in our properties.
- DRMacIver 11y agoIt's pretty easy to do this sort of thing in Hypothesis. You can also use [the support for stateful testing directly](http://hypothesis.readthedocs.org/en/latest/stateful.html http://hypothesis.readthedocs.org/en/latest/stateful.html). I find there's still a place for more granular tests that look more like your classic property based tests with a bit more imperative state floating around though.