File: test_read_log_numpy2.patch

package info (click to toggle)
python-gsd 4.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,020 kB
  • sloc: python: 3,252; ansic: 1,965; cpp: 129; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 972 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
Index: python-gsd/gsd/test/test_hoomd.py
===================================================================
--- python-gsd.orig/gsd/test/test_hoomd.py	2025-08-11 10:19:13.131516483 +0200
+++ python-gsd/gsd/test/test_hoomd.py	2025-08-11 10:19:13.127516771 +0200
@@ -11,6 +11,7 @@
 import gsd.fl
 import gsd.hoomd
 
+has_numpy_2 = int(numpy.version.version.split('.')[0]) >= 2
 
 def test_create(tmp_path):
     """Test that gsd files can be created."""
@@ -869,7 +870,7 @@
         with pytest.raises(ValueError):
             hf.append(frame)
 
-
+@pytest.mark.skipif(not has_numpy_2, reason="read_log requires numpy 2")
 def test_read_log(tmp_path):
     """Test that data logged in gsd files are read correctly."""
     frame0 = gsd.hoomd.Frame()
@@ -971,6 +972,7 @@
     )
 
 
+@pytest.mark.skipif(not has_numpy_2, reason="read_log requires numpy 2")
 def test_read_log_warning(tmp_path):
     """Test that read_log issues a warning."""
     frame = gsd.hoomd.Frame()