When defining strategies, is it possible to reference another strategy?
@given(maximum=strategies.floats(min_value=0),
actual=strategies.floats(max_value=maximum))
def foo(maximum, actual):
pass
This throws NameError: 'maximum' not defined'
Edit:
A workaround (or perhaps the workaround), is to use hypothesis's assume
function. In my case, it looks like:
@given(maximum=strategies.floats(min_value=0),
actual=strategies.floats(min_value=0))
def foo(maximum, actual):
assume(actual <= maximum)
pass