File: tests_dont_assume_endian.patch

package info (click to toggle)
pandas 2.2.3%2Bdfsg-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,784 kB
  • sloc: python: 422,228; ansic: 9,190; sh: 270; xml: 102; makefile: 83
file content (31 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download
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
Description: Don't assume little-endian in test references

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

--- a/pandas/tests/indexes/interval/test_constructors.py
+++ b/pandas/tests/indexes/interval/test_constructors.py
@@ -23,7 +23,7 @@ from pandas import (
 import pandas._testing as tm
 from pandas.core.arrays import IntervalArray
 import pandas.core.common as com
-
+from pandas.compat import is_platform_little_endian
 
 @pytest.fixture(params=[None, "foo"])
 def name(request):
@@ -44,12 +44,12 @@ class ConstructorTests:
             (Index(np.arange(-10, 11, dtype=np.int64)), np.int64),
             (Index(np.arange(10, 31, dtype=np.uint64)), np.uint64),
             (Index(np.arange(20, 30, 0.5), dtype=np.float64), np.float64),
-            (date_range("20180101", periods=10), "<M8[ns]"),
+            (date_range("20180101", periods=10), "<M8[ns]" if is_platform_little_endian() else ">M8[ns]"),
             (
                 date_range("20180101", periods=10, tz="US/Eastern"),
                 "datetime64[ns, US/Eastern]",
             ),
-            (timedelta_range("1 day", periods=10), "<m8[ns]"),
+            (timedelta_range("1 day", periods=10), "<m8[ns]" if is_platform_little_endian() else ">m8[ns]"),
         ]
     )
     def breaks_and_expected_subtype(self, request):