File: test_endian.patch

package info (click to toggle)
h5py 3.14.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: python: 11,425; ansic: 578; makefile: 429; sh: 33
file content (26 lines) | stat: -rw-r--r-- 1,096 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
Index: h5py/h5py/tests/test_dataset.py
===================================================================
--- h5py.orig/h5py/tests/test_dataset.py	2025-08-27 15:04:34.971809681 +0200
+++ h5py/h5py/tests/test_dataset.py	2025-08-27 18:40:48.600583617 +0200
@@ -48,10 +48,11 @@
     """
         Feature: repr(Dataset) behaves sensibly
     """
+    endian_mark = '>' if sys.byteorder=='big' else '<'
 
     def test_repr_basic(self):
         ds = self.f.create_dataset('foo', (4,), dtype='int32')
-        assert repr(ds) == '<HDF5 dataset "foo": shape (4,), type "<i4">'
+        assert repr(ds) == f'<HDF5 dataset "foo": shape (4,), type "{self.endian_mark}i4">'
 
     def test_repr_closed(self):
         """ repr() works on live and dead datasets """
@@ -61,7 +62,7 @@
 
     def test_repr_anonymous(self):
         ds = self.f.create_dataset(None, (4,), dtype='int32')
-        assert repr(ds) == '<HDF5 dataset (anonymous): shape (4,), type "<i4">'
+        assert repr(ds) == f'<HDF5 dataset (anonymous): shape (4,), type "{self.endian_mark}i4">'
 
 
 class TestCreateShape(BaseDataset):