Skip to content

Commit deea056

Browse files
Backport PR pandas-dev#45910: TST/CI: Set hypothesis deadline to None to avoid flaky failures (pandas-dev#45919)
Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 58aebf1 commit deea056

File tree

5 files changed

+5
-16
lines changed

5 files changed

+5
-16
lines changed

pandas/conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ def pytest_collection_modifyitems(items, config):
155155
# is too short for a specific test, (a) try to make it faster, and (b)
156156
# if it really is slow add `@settings(deadline=...)` with a working value,
157157
# or `deadline=None` to entirely disable timeouts for that test.
158-
deadline=500,
158+
# 2022-02-09: Changed deadline from 500 -> None. Deadline leads to
159+
# non-actionable, flaky CI failures (# GH 24641, 44969, 45118, 44969)
160+
deadline=None,
159161
suppress_health_check=(hypothesis.HealthCheck.too_slow,),
160162
)
161163
hypothesis.settings.load_profile("ci")

pandas/tests/frame/indexing/test_where.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
from datetime import datetime
22

3-
from hypothesis import (
4-
given,
5-
settings,
6-
)
3+
from hypothesis import given
74
import numpy as np
85
import pytest
96

@@ -924,7 +921,6 @@ def test_where_nullable_invalid_na(frame_or_series, any_numeric_ea_dtype):
924921

925922

926923
@given(data=OPTIONAL_ONE_OF_ALL)
927-
@settings(deadline=None) # GH 44969
928924
def test_where_inplace_casting(data):
929925
# GH 22051
930926
df = DataFrame({"a": data})

pandas/tests/io/parser/test_parse_dates.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
import warnings
1212

1313
from dateutil.parser import parse as du_parse
14-
from hypothesis import (
15-
given,
16-
settings,
17-
)
14+
from hypothesis import given
1815
import numpy as np
1916
import pytest
2017
import pytz
@@ -1696,7 +1693,6 @@ def _helper_hypothesis_delimited_date(call, date_string, **kwargs):
16961693

16971694
@skip_pyarrow
16981695
@given(DATETIME_NO_TZ)
1699-
@settings(deadline=None)
17001696
@pytest.mark.parametrize("delimiter", list(" -./"))
17011697
@pytest.mark.parametrize("dayfirst", [True, False])
17021698
@pytest.mark.parametrize(

pandas/tests/tseries/offsets/test_offsets_properties.py

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from hypothesis import (
1111
assume,
1212
given,
13-
settings,
1413
)
1514
import pytest
1615
import pytz
@@ -46,7 +45,6 @@ def test_on_offset_implementations(dt, offset):
4645

4746

4847
@given(YQM_OFFSET)
49-
@settings(deadline=None) # GH 45118
5048
def test_shift_across_dst(offset):
5149
# GH#18319 check that 1) timezone is correctly normalized and
5250
# 2) that hour is not incorrectly changed by this normalization

pandas/tests/tseries/offsets/test_ticks.py

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
assume,
1111
example,
1212
given,
13-
settings,
1413
)
1514
import numpy as np
1615
import pytest
@@ -62,7 +61,6 @@ def test_delta_to_tick():
6261

6362

6463
@pytest.mark.parametrize("cls", tick_classes)
65-
@settings(deadline=None) # GH 24641
6664
@example(n=2, m=3)
6765
@example(n=800, m=300)
6866
@example(n=1000, m=5)
@@ -84,7 +82,6 @@ def test_tick_add_sub(cls, n, m):
8482

8583
@pytest.mark.arm_slow
8684
@pytest.mark.parametrize("cls", tick_classes)
87-
@settings(deadline=None)
8885
@example(n=2, m=3)
8986
@given(n=INT_NEG_999_TO_POS_999, m=INT_NEG_999_TO_POS_999)
9087
def test_tick_equality(cls, n, m):

0 commit comments

Comments
 (0)