diff --git a/pandas/conftest.py b/pandas/conftest.py index f9c10a7758bd2..a518b35755fad 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -176,25 +176,19 @@ def pytest_collection_modifyitems(items, config) -> None: ignore_doctest_warning(item, path, message) -hypothesis_health_checks = [ - hypothesis.HealthCheck.too_slow, - hypothesis.HealthCheck.differing_executors, -] - -# Hypothesis +# Similar to "ci" config in +# https://hypothesis.readthedocs.io/en/latest/reference/api.html#built-in-profiles hypothesis.settings.register_profile( - "ci", - # Hypothesis timing checks are tuned for scalars by default, so we bump - # them from 200ms to 500ms per test case as the global default. If this - # is too short for a specific test, (a) try to make it faster, and (b) - # if it really is slow add `@settings(deadline=...)` with a working value, - # or `deadline=None` to entirely disable timeouts for that test. - # 2022-02-09: Changed deadline from 500 -> None. Deadline leads to - # non-actionable, flaky CI failures (# GH 24641, 44969, 45118, 44969) + "pandas_ci", + database=None, deadline=None, - suppress_health_check=tuple(hypothesis_health_checks), + max_examples=15, + suppress_health_check=( + hypothesis.HealthCheck.too_slow, + hypothesis.HealthCheck.differing_executors, + ), ) -hypothesis.settings.load_profile("ci") +hypothesis.settings.load_profile("pandas_ci") # Registering these strategies makes them globally available via st.from_type, # which is use for offsets in tests/tseries/offsets/test_offsets_properties.py diff --git a/pandas/tests/frame/test_stack_unstack.py b/pandas/tests/frame/test_stack_unstack.py index 22fdfd3a01408..3ff7483f30e05 100644 --- a/pandas/tests/frame/test_stack_unstack.py +++ b/pandas/tests/frame/test_stack_unstack.py @@ -2227,7 +2227,7 @@ def test_unstack_unobserved_keys(self, future_stack): tm.assert_frame_equal(recons, df) @pytest.mark.slow - def test_unstack_number_of_levels_larger_than_int32( + def test_unstack_number_of_levels_larger_than_int32_warns( self, performance_warning, monkeypatch ): # GH#20601 @@ -2239,6 +2239,9 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) raise Exception("Don't compute final result.") + def _make_selectors(self) -> None: + pass + with monkeypatch.context() as m: m.setattr(reshape_lib, "_Unstacker", MockUnstacker) df = DataFrame( diff --git a/pandas/tests/reshape/test_pivot.py b/pandas/tests/reshape/test_pivot.py index 2a58815c1cece..3aa79c4e4b517 100644 --- a/pandas/tests/reshape/test_pivot.py +++ b/pandas/tests/reshape/test_pivot.py @@ -2144,7 +2144,7 @@ def test_pivot_string_func_vs_func(self, f, f_numpy, data): tm.assert_frame_equal(result, expected) @pytest.mark.slow - def test_pivot_number_of_levels_larger_than_int32( + def test_pivot_number_of_levels_larger_than_int32_warns( self, performance_warning, monkeypatch ): # GH 20601 @@ -2155,6 +2155,9 @@ def __init__(self, *args, **kwargs) -> None: super().__init__(*args, **kwargs) raise Exception("Don't compute final result.") + def _make_selectors(self) -> None: + pass + with monkeypatch.context() as m: m.setattr(reshape_lib, "_Unstacker", MockUnstacker) df = DataFrame(