I encountered an issue with the hypothesis package version 6.115.2 when running a test case that uses the @hypothesis.given decorator with an integers strategy. The error occurs specifically with Python 3.10.5 and does not manifest with Python 3.8 or older versions of hypothesis (e.g., 6.115.0).
Steps to Reproduce:
Install hypothesis version 6.115.2.
Use Python 3.10.5 to run the following test case:
import hypothesis
@hypothesis.given(size=hypothesis.strategies.integers(min_value=121, max_value=255))
@hypothesis.seed(5196489849994870713126665243569287741) # Seed to reproduce the issue
def test(size):
pass
test()
Observe the traceback.
Expected Behavior:
The test should execute without errors, generating integers between 121 and 255.
Actual Behavior:
An IndexError: list index out of range is raised during execution. The traceback points to the choice method in random.py:
Traceback (most recent call last):
....
File: "xxx/random.py", line 3789, in choice
return seq[self._randbelow(len(seq))]
IndexError: list index out of range
Environment:
hypothesis version: 6.115.2
Python version: 3.10.5
Operating System: Windows
Additional Information:
The seed used for reproducing the issue is 5196489849994870713126665243569287741.
Description:
I encountered an issue with the hypothesis package version 6.115.2 when running a test case that uses the @hypothesis.given decorator with an integers strategy. The error occurs specifically with Python 3.10.5 and does not manifest with Python 3.8 or older versions of hypothesis (e.g., 6.115.0).
Steps to Reproduce:
Expected Behavior:
The test should execute without errors, generating integers between 121 and 255.
Actual Behavior:
An IndexError: list index out of range is raised during execution. The traceback points to the choice method in random.py:
Environment:
Additional Information:
The seed used for reproducing the issue is 5196489849994870713126665243569287741.