We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert min_value is not None
@given(i=integers()) exploded with assertion error on assert min_value is not None. Huh?
@given(i=integers())
Trivial do-nothing test case:
from hypothesis import given, settings from hypothesis.strategies import integers @given(i=integers()) @settings(max_examples=50000) def test_dummy(i): assert i is i
Run it with: pytest --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py
pytest --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py
On my machine it takes about 12 seconds until it asserts, but it asserts reliably.
@given(i=integers()) > @settings(max_examples=50000) tgiven.py:6: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py:543: in run self._run() /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py:973: in _run self.generate_new_examples() /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py:755: in generate_new_examples prefix = self.generate_novel_prefix() /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/engine.py:399: in generate_novel_prefix return self.tree.generate_novel_prefix(self.random) /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/datatree.py:766: in generate_novel_prefix (v, buf) = self._draw_from_cache( /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/datatree.py:904: in _draw_from_cache for v in generator: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ir_type = 'integer', kwargs = {'max_value': None, 'min_value': None, 'shrink_towards': 0, 'weights': None} def all_children(ir_type, kwargs): if ir_type == "integer": min_value = kwargs["min_value"] max_value = kwargs["max_value"] weights = kwargs["weights"] # it's a bit annoying (but completely feasible) to implement the cases # other than "both sides bounded" here. We haven't needed to yet because # in practice we don't struggle with unbounded integer generation. > assert min_value is not None E assert None is not None /usr/lib/python3.12/site-packages/hypothesis/internal/conjecture/datatree.py:270: AssertionError ============================================= short test summary info ============================================== FAILED tgiven.py::test_dummy - assert None is not None
Debug log generated with pytest --hypothesis-verbosity=debug --full-trace --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py &> debug.log is attached here:
pytest --hypothesis-verbosity=debug --full-trace --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py &> debug.log
debug.log.gz
The text was updated successfully, but these errors were encountered:
all_children
tybug
Successfully merging a pull request may close this issue.
Versions tested
Summary
@given(i=integers())
exploded with assertion error onassert min_value is not None
. Huh?Reproducer
Trivial do-nothing test case:
Run it with:
pytest --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py
On my machine it takes about 12 seconds until it asserts, but it asserts reliably.
Traceback
Debug log generated with
pytest --hypothesis-verbosity=debug --full-trace --hypothesis-seed=55662285600128535524272749666366957831 tgiven.py &> debug.log
is attached here:debug.log.gz
The text was updated successfully, but these errors were encountered: