summaryrefslogtreecommitdiff
path: root/dev-python/xarray/files/xarray-0.19.0-riscv_tests_datetime.patch
blob: 1f356e95b561cf8c56194ed01e5f86ce47d3e106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
These tests are x86{_64}-centric because they rely on a specific result of
casting a float64 NaN to int64, which is undefined in the C standard.
See https://github.com/numpy/numpy/issues/8325 for details.

--- a/xarray/tests/__init__.py
+++ b/xarray/tests/__init__.py
@@ -40,6 +40,12 @@
 )
 
 
+riscv_xfail = pytest.mark.xfail(
+    "riscv" in platform.machine(),
+    reason="expected failure on RISC-V",
+)
+
+
 def _importorskip(modname, minversion=None):
     try:
         mod = importlib.import_module(modname)
--- a/xarray/tests/test_backends.py
+++ b/xarray/tests/test_backends.py
@@ -71,6 +71,7 @@
     requires_scipy,
     requires_scipy_or_netCDF4,
     requires_zarr,
+    riscv_xfail,
 )
 from .test_coding_times import (
     _ALL_CALENDARS,
@@ -492,6 +493,7 @@
             assert actual["x"].encoding["_Encoding"] == "ascii"
 
     @arm_xfail
+    @riscv_xfail
     def test_roundtrip_numpy_datetime_data(self):
         times = pd.to_datetime(["2000-01-01", "2000-01-02", "NaT"])
         expected = Dataset({"t": ("t", times), "t0": times[0]})
--- a/xarray/tests/test_coding_times.py
+++ b/xarray/tests/test_coding_times.py
@@ -36,6 +36,7 @@
     requires_cftime,
     requires_cftime_1_4_1,
     requires_dask,
+    riscv_xfail,
 )
 
 _NON_STANDARD_CALENDARS_SET = {
@@ -466,6 +467,7 @@
 
 
 @arm_xfail
+@riscv_xfail
 @requires_cftime
 @pytest.mark.parametrize(
     ["num_dates", "units", "expected_list"],
--- a/xarray/tests/test_duck_array_ops.py
+++ b/xarray/tests/test_duck_array_ops.py
@@ -38,6 +38,7 @@
     requires_bottleneck,
     requires_cftime,
     requires_dask,
+    riscv_xfail,
 )
 
 
@@ -280,6 +281,7 @@
 
 
 @arm_xfail
+@riscv_xfail
 @pytest.mark.filterwarnings("ignore::RuntimeWarning")
 @pytest.mark.parametrize("dask", [False, True] if has_dask else [False])
 def test_datetime_mean(dask):