diff --git a/pandas/_testing/_hypothesis.py b/pandas/_testing/_hypothesis.py index 0e506f5e878b4..5256a303de34e 100644 --- a/pandas/_testing/_hypothesis.py +++ b/pandas/_testing/_hypothesis.py @@ -44,6 +44,10 @@ min_size=3, ) +OPTIONAL_ONE_OF_ALL = st.one_of( + OPTIONAL_DICTS, OPTIONAL_FLOATS, OPTIONAL_INTS, OPTIONAL_LISTS, OPTIONAL_TEXT +) + if is_platform_windows(): DATETIME_NO_TZ = st.datetimes(min_value=datetime(1900, 1, 1)) else: diff --git a/pandas/tests/frame/indexing/test_where.py b/pandas/tests/frame/indexing/test_where.py index a079a3a7921d7..e668e77644082 100644 --- a/pandas/tests/frame/indexing/test_where.py +++ b/pandas/tests/frame/indexing/test_where.py @@ -2,7 +2,7 @@ from hypothesis import ( given, - strategies as st, + settings, ) import numpy as np import pytest @@ -22,13 +22,7 @@ isna, ) import pandas._testing as tm -from pandas._testing._hypothesis import ( - OPTIONAL_DICTS, - OPTIONAL_FLOATS, - OPTIONAL_INTS, - OPTIONAL_LISTS, - OPTIONAL_TEXT, -) +from pandas._testing._hypothesis import OPTIONAL_ONE_OF_ALL @pytest.fixture(params=["default", "float_string", "mixed_float", "mixed_int"]) @@ -874,11 +868,8 @@ def test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype): obj.mask(mask, null) -@given( - data=st.one_of( - OPTIONAL_DICTS, OPTIONAL_FLOATS, OPTIONAL_INTS, OPTIONAL_LISTS, OPTIONAL_TEXT - ) -) +@given(data=OPTIONAL_ONE_OF_ALL) +@settings(deadline=None) # GH 44969 def test_where_inplace_casting(data): # GH 22051 df = DataFrame({"a": data})