You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since version 6.98.12 (and #3795/#3895) the numpy arrays() strategy seems to not respect the type of its dtype parameter anymore.
The documentation states for parameter elements
elements is a strategy for generating values to put in the array. If it is None a suitable value will be inferred based on the dtype, which may give any legal value (including eg NaN for floats).
This seems to have stopped working in the recent releases for at least dtype np.uint32, so test data generation produces a lot of invalid arguments and often triggers the health check. Once you pass a strategy for valid values (e.g. st.integers(min_value=0, max_value=2**32 - 1)) test generation does work again.
To reproduce run the following as python file with pytest -s (you need numpy and pytest and a recent hypothesis installed). It will either let the first test fail (healthcheck triggers because of invalid samples) or be really slow.
Thanks for the report - this is clearly a pretty serious bug, and shipping it implies that we also need to improve our tests for dtype inference. I'll likely get to this over the weekend.
Since version
6.98.12
(and #3795/#3895) the numpyarrays()
strategy seems to not respect the type of itsdtype
parameter anymore.The documentation states for parameter
elements
This seems to have stopped working in the recent releases for at least dtype
np.uint32
, so test data generation produces a lot of invalid arguments and often triggers the health check. Once you pass a strategy for valid values (e.g.st.integers(min_value=0, max_value=2**32 - 1)
) test generation does work again.To reproduce run the following as python file with
pytest -s
(you need numpy and pytest and a recent hypothesis installed). It will either let the first test fail (healthcheck triggers because of invalid samples) or be really slow.The text was updated successfully, but these errors were encountered: