From fd6a6560830f45b5414e9fddcc0fd3d3472ccde6 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Sat, 13 Aug 2022 22:38:43 -0700 Subject: [PATCH] Backport PR #48065: CI/DEPS: Fix timezone test due to pytz upgrade --- pandas/tests/tseries/offsets/test_dst.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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", ), ), (