File: test_read_log_numpy2.patch

package info (click to toggle)
python-gsd 3.4.2-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,020 kB
  • sloc: python: 3,141; ansic: 2,057; cpp: 120; makefile: 16
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-02-12 16:03:02.595051636 +0100
+++ python-gsd/gsd/test/test_hoomd.py	2025-02-13 10:28:03.844678835 +0100
@@ -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."""
@@ -868,7 +869,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()
@@ -970,6 +971,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()