79566122

Date: 2025-04-10 08:34:32
Score: 1.5
Natty:
Report link

Yes, it is possible to provide partial examples in Hypothesis, but the way it's handled depends on the specifics of how you use the @example decorator alongside @given. Let me clarify how this works and address your case.

So, in your example:

from hypothesis import given, example
import hypothesis.strategies as st

@given(a=st.integers(), b=st.integers())
@example(a=0)
def test_example(a, b):
    assert isinstance(a, int)
    assert isinstance(b, int)
Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @example
  • User mentioned (0): @given
  • Low reputation (1):
Posted by: Christopher Enoch