diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 0fa9081d606b0..8d9b54cf3f0df 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -13,6 +13,7 @@ from hypothesis.extra.dateutil import timezones as dateutil_timezones from hypothesis.extra.pytz import timezones as pytz_timezones import pytest +import pytz import pandas as pd from pandas import Timestamp @@ -92,7 +93,13 @@ def test_on_offset_implementations(dt, offset): # check that the class-specific implementations of is_on_offset match # the general case definition: # (dt + offset) - offset == dt - compare = (dt + offset) - offset + try: + compare = (dt + offset) - offset + except pytz.NonExistentTimeError: + # dt + offset does not exist, assume(False) to indicate + # to hypothesis that this is not a valid test case + assume(False) + assert offset.is_on_offset(dt) == (compare == dt)