def test_bounded_integer_strategy_only_produces_in_range(): s = strat.BoundedIntStrategy(1, 10) assert not s.could_have_produced(0) assert not s.could_have_produced(11)
def test_rejects_invalid_ranges(): with pytest.raises(ValueError): strat.BoundedIntStrategy(10, 9)
def test_does_not_simplify_outside_range(): n = 3 s = strat.BoundedIntStrategy(0, n) for t in s.simplify(n): assert 0 <= t <= n
def define_stragy_for_integer_Range(strategies, descriptor): return strat.BoundedIntStrategy(descriptor.start, descriptor.end)