From 11612f316e4614df7888432d7842e0d1e4a27553 Mon Sep 17 00:00:00 2001 From: Debian Science Team Date: Sun, 2 Feb 2025 11:17:13 +0000 Subject: [PATCH] Don't require 32-bit to be time32 Debian armhf/armel (but not i386) are now time64 Author: Graham Inggs, Rebecca N. Palmer Bug-Debian: https://bugs.debian.org/1068104 Forwarded: no Gbp-Pq: Name 1068104_time64.patch --- .../indexes/datetimes/methods/test_resolution.py | 2 +- pandas/tests/io/sas/test_sas7bdat.py | 11 +++++++---- pandas/tests/tools/test_to_timedelta.py | 2 +- pandas/tests/tseries/offsets/test_common.py | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pandas/tests/indexes/datetimes/methods/test_resolution.py b/pandas/tests/indexes/datetimes/methods/test_resolution.py index 8399fafb..1400d074 100644 --- a/pandas/tests/indexes/datetimes/methods/test_resolution.py +++ b/pandas/tests/indexes/datetimes/methods/test_resolution.py @@ -24,7 +24,7 @@ def test_dti_resolution(request, tz_naive_fixture, freq, expected): tz = tz_naive_fixture if freq == "YE" and not IS64 and isinstance(tz, tzlocal): request.applymarker( - pytest.mark.xfail(reason="OverflowError inside tzlocal past 2038") + pytest.mark.xfail(reason="OverflowError inside tzlocal past 2038", strict=False) ) idx = date_range(start="2013-04-01", periods=30, freq=freq, tz=tz) diff --git a/pandas/tests/io/sas/test_sas7bdat.py b/pandas/tests/io/sas/test_sas7bdat.py index b71896c7..d59100e5 100644 --- a/pandas/tests/io/sas/test_sas7bdat.py +++ b/pandas/tests/io/sas/test_sas7bdat.py @@ -15,6 +15,9 @@ import pandas as pd import pandas._testing as tm from pandas.io.sas.sas7bdat import SAS7BDATReader +import platform +import re +is_platform_x86_32 = bool(re.match("i.?86|x86", platform.uname()[4])) and not IS64 @pytest.fixture @@ -202,7 +205,7 @@ def test_date_time(datapath): res = df0["DateTimeHi"].astype("M8[us]").dt.round("ms") df0["DateTimeHi"] = res.astype("M8[ms]") - if not IS64: + if is_platform_x86_32: # No good reason for this, just what we get on the CI df0.loc[0, "DateTimeHi"] += np.timedelta64(1, "ms") df0.loc[[2, 3], "DateTimeHi"] -= np.timedelta64(1, "ms") @@ -297,7 +300,7 @@ def test_max_sas_date(datapath): columns=["text", "dt_as_float", "dt_as_dt", "date_as_float", "date_as_date"], ) - if not IS64: + if is_platform_x86_32: # No good reason for this, just what we get on the CI expected.loc[:, "dt_as_dt"] -= np.timedelta64(1, "ms") @@ -340,7 +343,7 @@ def test_max_sas_date_iterator(datapath): columns=col_order, ), ] - if not IS64: + if is_platform_x86_32: # No good reason for this, just what we get on the CI expected[0].loc[0, "dt_as_dt"] -= np.timedelta64(1, "ms") expected[1].loc[0, "dt_as_dt"] -= np.timedelta64(1, "ms") @@ -371,7 +374,7 @@ def test_null_date(datapath): ), }, ) - if not IS64: + if is_platform_x86_32: # No good reason for this, just what we get on the CI expected.loc[0, "datetimecol"] -= np.timedelta64(1, "ms") tm.assert_frame_equal(df, expected) diff --git a/pandas/tests/tools/test_to_timedelta.py b/pandas/tests/tools/test_to_timedelta.py index b67694f1..5a75988e 100644 --- a/pandas/tests/tools/test_to_timedelta.py +++ b/pandas/tests/tools/test_to_timedelta.py @@ -244,7 +244,7 @@ class TestTimedeltas: actual = to_timedelta([val]) assert actual[0]._value == np.timedelta64("NaT").astype("int64") - @pytest.mark.xfail(not IS64, reason="Floating point error") + @pytest.mark.xfail(not IS64, reason="Floating point error", strict=False) def test_to_timedelta_float(self): # https://github.com/pandas-dev/pandas/issues/25077 arr = np.arange(0, 1, 1e-6)[-10:] diff --git a/pandas/tests/tseries/offsets/test_common.py b/pandas/tests/tseries/offsets/test_common.py index aa4e22f7..03334da9 100644 --- a/pandas/tests/tseries/offsets/test_common.py +++ b/pandas/tests/tseries/offsets/test_common.py @@ -143,7 +143,7 @@ def test_apply_out_of_range(request, tz_naive_fixture, _offset): # If we hit OutOfBoundsDatetime on non-64 bit machines # we'll drop out of the try clause before the next test request.applymarker( - pytest.mark.xfail(reason="OverflowError inside tzlocal past 2038") + pytest.mark.xfail(reason="OverflowError inside tzlocal past 2038", strict=False) ) elif ( isinstance(tz, tzlocal) -- 2.30.2