diff --git a/pandas/tests/tseries/offsets/test_dst.py b/pandas/tests/tseries/offsets/test_dst.py index 50c5a91fc2390..9c6d6a686e9a5 100644 --- a/pandas/tests/tseries/offsets/test_dst.py +++ b/pandas/tests/tseries/offsets/test_dst.py @@ -31,6 +31,10 @@ ) from pandas.tests.tseries.offsets.test_offsets import get_utc_offset_hours +from pandas.util.version import Version + +# error: Module has no attribute "__version__" +pytz_version = Version(pytz.__version__) # type: ignore[attr-defined] class TestDST: @@ -186,9 +190,8 @@ def test_all_offset_classes(self, tup): MonthBegin(66), "Africa/Kinshasa", marks=pytest.mark.xfail( - # error: Module has no attribute "__version__" - float(pytz.__version__) <= 2020.1, # type: ignore[attr-defined] - reason="GH#41906", + pytz_version < Version("2020.5") or pytz_version == Version("2022.2"), + reason="GH#41906: pytz utc transition dates changed", ), ), (