From eea95a304795d5c0e72494a645af417e0449bc9f Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 5 Nov 2024 16:26:40 -0800 Subject: [PATCH] TST: Skip flaky offset test case on WASM (#60186) * TST: Skip flaky offset test case on WASM * Check tzinfo exists * Check for zoneinfo directly * Undo original change * Try installing tzdata to fix * Revert "Try installing tzdata to fix" This reverts commit 6698cd5de18a9a4cf03dc1ae86ffe8a10461eee5. * Revert "Undo original change" This reverts commit 5bc727258e669050cb0b30e2d652fbd85e86e8da. --- .../tseries/offsets/test_offsets_properties.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 943434e515828..809d8f87b2c02 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -8,12 +8,16 @@ tests, or when trying to pin down the bugs exposed by the tests below. """ +import zoneinfo + from hypothesis import ( assume, given, ) import pytest +from pandas.compat import WASM + import pandas as pd from pandas._testing._hypothesis import ( DATETIME_JAN_1_1900_OPTIONAL_TZ, @@ -28,6 +32,15 @@ @given(DATETIME_JAN_1_1900_OPTIONAL_TZ, YQM_OFFSET) def test_on_offset_implementations(dt, offset): assume(not offset.normalize) + # This case is flaky in CI 2024-11-04 + assume( + not ( + WASM + and isinstance(dt.tzinfo, zoneinfo.ZoneInfo) + and dt.tzinfo.key == "Indian/Cocos" + and isinstance(offset, pd.offsets.MonthBegin) + ) + ) # check that the class-specific implementations of is_on_offset match # the general case definition: # (dt + offset) - offset == dt