From 578500441a3caaaf825f4d14325b7d2d18272797 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:28:31 -0800 Subject: [PATCH 1/5] TST/CI: Fix test_repr on musl --- pandas/tests/scalar/timestamp/test_formats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timestamp/test_formats.py b/pandas/tests/scalar/timestamp/test_formats.py index 6a578b0a9eb09..d4b93c92c8327 100644 --- a/pandas/tests/scalar/timestamp/test_formats.py +++ b/pandas/tests/scalar/timestamp/test_formats.py @@ -99,13 +99,13 @@ def test_repr(self, date, freq, tz): # avoid to match with timezone name freq_repr = f"'{freq}'" if tz.startswith("dateutil"): - tz_repr = tz.replace("dateutil", "") + tz_repr = tz.replace("dateutil/", "") else: tz_repr = tz date_only = Timestamp(date) assert date in repr(date_only) - assert tz_repr not in repr(date_only) + assert tz_repr not in repr(date_only), repr(date_only) assert freq_repr not in repr(date_only) assert date_only == eval(repr(date_only)) From aaf05c5295660c831a6e11ecdfc2f50912ae23e0 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:41:28 -0800 Subject: [PATCH 2/5] Fix windows test too --- pandas/tests/io/pytables/test_timezones.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/io/pytables/test_timezones.py b/pandas/tests/io/pytables/test_timezones.py index b455235669636..9192804e49bd1 100644 --- a/pandas/tests/io/pytables/test_timezones.py +++ b/pandas/tests/io/pytables/test_timezones.py @@ -104,7 +104,7 @@ def test_append_with_timezones(setup_path, gettz): msg = ( r"invalid info for \[values_block_1\] for \[tz\], " - r"existing_value \[(dateutil/.*)?US/Eastern\] " + r"existing_value \[(dateutil/.*)?(US/Eastern|America/New_York)\] " r"conflicts with new value \[(dateutil/.*)?EET\]" ) with pytest.raises(ValueError, match=msg): From 8434b1ce0bbbe3fbb3a243adcd857aff62cc48e5 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:51:30 -0800 Subject: [PATCH 3/5] Check other call --- pandas/tests/scalar/timestamp/test_formats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timestamp/test_formats.py b/pandas/tests/scalar/timestamp/test_formats.py index d4b93c92c8327..db34a8162c543 100644 --- a/pandas/tests/scalar/timestamp/test_formats.py +++ b/pandas/tests/scalar/timestamp/test_formats.py @@ -105,13 +105,13 @@ def test_repr(self, date, freq, tz): date_only = Timestamp(date) assert date in repr(date_only) - assert tz_repr not in repr(date_only), repr(date_only) + assert tz_repr not in repr(date_only) assert freq_repr not in repr(date_only) assert date_only == eval(repr(date_only)) date_tz = Timestamp(date, tz=tz) assert date in repr(date_tz) - assert tz_repr in repr(date_tz) + assert tz_repr in repr(date_tz), repr(date_tz) assert freq_repr not in repr(date_tz) assert date_tz == eval(repr(date_tz)) From 070693da284cbbba9e104959452df11ecb5a36f1 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:12:59 -0800 Subject: [PATCH 4/5] Remap US/Pacific to America/Los_Angeles --- pandas/tests/scalar/timestamp/test_formats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/scalar/timestamp/test_formats.py b/pandas/tests/scalar/timestamp/test_formats.py index db34a8162c543..a065c78fc6666 100644 --- a/pandas/tests/scalar/timestamp/test_formats.py +++ b/pandas/tests/scalar/timestamp/test_formats.py @@ -89,7 +89,7 @@ def test_isoformat(ts, timespec, expected_iso): class TestTimestampRendering: @pytest.mark.parametrize( - "tz", ["UTC", "Asia/Tokyo", "US/Eastern", "dateutil/US/Pacific"] + "tz", ["UTC", "Asia/Tokyo", "US/Eastern", "dateutil/America/Los_Angeles"] ) @pytest.mark.parametrize("freq", ["D", "M", "S", "N"]) @pytest.mark.parametrize( @@ -99,7 +99,7 @@ def test_repr(self, date, freq, tz): # avoid to match with timezone name freq_repr = f"'{freq}'" if tz.startswith("dateutil"): - tz_repr = tz.replace("dateutil/", "") + tz_repr = tz.replace("dateutil", "") else: tz_repr = tz From fb8f6b0a066957d1a7328f95f23bd5b54a1cc13f Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:13:37 -0800 Subject: [PATCH 5/5] remove debug --- pandas/tests/scalar/timestamp/test_formats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/scalar/timestamp/test_formats.py b/pandas/tests/scalar/timestamp/test_formats.py index a065c78fc6666..b4493088acb31 100644 --- a/pandas/tests/scalar/timestamp/test_formats.py +++ b/pandas/tests/scalar/timestamp/test_formats.py @@ -111,7 +111,7 @@ def test_repr(self, date, freq, tz): date_tz = Timestamp(date, tz=tz) assert date in repr(date_tz) - assert tz_repr in repr(date_tz), repr(date_tz) + assert tz_repr in repr(date_tz) assert freq_repr not in repr(date_tz) assert date_tz == eval(repr(date_tz))