File: test_adios2_skip.patch

package info (click to toggle)
fenics-dolfinx 1%3A0.10.0.post4-1exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,028 kB
  • sloc: cpp: 36,535; python: 25,391; makefile: 226; sh: 171; xml: 55
file content (92 lines) | stat: -rw-r--r-- 3,495 bytes parent folder | download | duplicates (2)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Index: fenics-dolfinx/python/test/unit/io/test_adios2.py
===================================================================
--- fenics-dolfinx.orig/python/test/unit/io/test_adios2.py	2025-11-12 15:37:08.417698540 +0100
+++ fenics-dolfinx/python/test/unit/io/test_adios2.py	2025-11-12 15:37:08.416706715 +0100
@@ -12,6 +12,7 @@
 import pytest
 
 import ufl
+import dolfinx.io
 from basix.ufl import element
 from dolfinx import default_real_type
 from dolfinx.fem import Function, functionspace
@@ -42,6 +43,9 @@
 class TestVTX:
     @pytest.mark.skipif(MPI.COMM_WORLD.size > 1, reason="This test should only be run in serial.")
     def test_second_order_vtx(self, tempdir):
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         filename = Path(tempdir, "mesh_vtx.bp")
@@ -55,6 +59,9 @@
     @pytest.mark.parametrize("dim", [2, 3])
     @pytest.mark.parametrize("simplex", [True, False])
     def test_vtx_mesh(self, tempdir, dim, simplex):
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         filename = Path(tempdir, "mesh_vtx.bp")
@@ -68,6 +75,9 @@
     @pytest.mark.parametrize("simplex", [True, False])
     def test_vtx_functions_fail(self, tempdir, dim, simplex):
         """Test for error when elements differ."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         mesh = generate_mesh(dim, simplex)
@@ -81,6 +91,9 @@
     @pytest.mark.parametrize("simplex", [True, False])
     def test_vtx_different_meshes_function(self, tempdir, simplex):
         """Test for error when functions do not share a mesh."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         mesh = generate_mesh(2, simplex)
@@ -96,6 +109,9 @@
     @pytest.mark.parametrize("simplex", [True, False])
     def test_vtx_functions(self, tempdir, dtype, dim, simplex):
         """Test saving high order Lagrange functions."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         xtype = np.real(dtype(0)).dtype
@@ -137,6 +153,9 @@
 
     def test_save_vtkx_cell_point(self, tempdir):
         """Test writing point-wise data."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         mesh = create_unit_square(MPI.COMM_WORLD, 8, 5)
@@ -154,6 +173,9 @@
 
     def test_empty_rank_mesh(self, tempdir):
         """Test VTXWriter on mesh where some ranks have no cells."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXWriter
 
         comm = MPI.COMM_WORLD
@@ -188,6 +210,9 @@
     @pytest.mark.parametrize("reuse", [True, False])
     def test_vtx_reuse_mesh(self, tempdir, dim, simplex, reuse):
         """Test reusage of mesh by VTXWriter."""
+        if not hasattr(dolfinx.io, "VTXWriter"):
+            pytest.skip("VTXWriter is not available")
+
         from dolfinx.io import VTXMeshPolicy, VTXWriter
 
         adios2 = pytest.importorskip("adios2", minversion="2.10.0")