From 3679dfb9b8597b60933e170ec9bf8a6a7c9c8731 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 26 May 2026 11:40:13 +0200 Subject: [PATCH] GH-50041: [CI][Python] Make test_string_to_tzinfo_pytz_fallback more robust for platforms supporting lower case tz names --- python/pyarrow/tests/test_types.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/python/pyarrow/tests/test_types.py b/python/pyarrow/tests/test_types.py index 4a33d79223d0..9b5c5efe1c30 100644 --- a/python/pyarrow/tests/test_types.py +++ b/python/pyarrow/tests/test_types.py @@ -511,11 +511,16 @@ def test_string_to_tzinfo_prefer_zoneinfo_false(): assert result == pytz.FixedOffset(90) -@pytest.mark.skipif( - sys.platform == 'darwin', reason="macOS supports those lower-case names" -) def test_string_to_tzinfo_pytz_fallback(): pytz = pytest.importorskip("pytz") + + try: + zoneinfo.ZoneInfo("europe/brussels") + except zoneinfo.ZoneInfoNotFoundError: + pass + else: + pytest.skip("zoneinfo supports lower-case names on this platform") + result = pa.lib.string_to_tzinfo("europe/brussels") expected = pytz.timezone("Europe/Brussels") assert result == expected