Skip to content

Tag: python-hypothesis

Generating an interval set in hypothesis

I have some code that works with intervals, which are really just python dicts with the following structure: Writing a strategy for a single interval is relatively straightforward. I’d like to write a strategy to generate interval sets. An interval set is a list of intervals, such that: The list contain…

Parametrized RuleBasedStateMachine

After watching https://www.youtube.com/watch?v=zi0rHwfiX1Q I tried to port the example from C (implementation) and Erlang (testing) to Python and Hypothesis. Given this implementation (the rem function emulates %’s C behavior): and this test code The actual question is how to use Hypothesis to also para…