Skip to content

Commit 89a15a8

Browse files
committed
Adapt python unit tests
1 parent ab57bfc commit 89a15a8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

python/test/unit/io/test_adios2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_second_order_vtx(self, tempdir):
6060
cells = np.array([[0, 1, 2]], dtype=np.int32)
6161
domain = ufl.Mesh(element("Lagrange", "interval", 2, shape=(1,), dtype=default_real_type))
6262
mesh = create_mesh(MPI.COMM_WORLD, cells, domain, points)
63-
with VTXWriter(mesh.comm, filename, mesh) as f:
63+
with VTXWriter(mesh.comm, filename, "w", mesh) as f:
6464
f.write(0.0)
6565

6666
@pytest.mark.parametrize("dim", [2, 3])
@@ -71,7 +71,7 @@ def test_vtx_mesh(self, tempdir, dim, simplex):
7171

7272
filename = Path(tempdir, "mesh_vtx.bp")
7373
mesh = generate_mesh(dim, simplex)
74-
with VTXWriter(mesh.comm, filename, mesh) as f:
74+
with VTXWriter(mesh.comm, filename, "w", mesh) as f:
7575
f.write(0.0)
7676
mesh.geometry.x[:, 1] += 0.1
7777
f.write(0.1)
@@ -88,7 +88,7 @@ def test_vtx_functions_fail(self, tempdir, dim, simplex):
8888
w = Function(functionspace(mesh, ("Lagrange", 1)))
8989
filename = Path(tempdir, "v.bp")
9090
with pytest.raises(RuntimeError):
91-
VTXWriter(mesh.comm, filename, [v, w])
91+
VTXWriter(mesh.comm, filename, "w", [v, w])
9292

9393
@pytest.mark.parametrize("dim", [2, 3])
9494
@pytest.mark.parametrize("simplex", [True, False])
@@ -102,7 +102,7 @@ def test_vtx_names_fail(self, tempdir, dim, simplex):
102102
w = Function(functionspace(mesh, ("Lagrange", 1)), name="f")
103103
filename = Path(tempdir, "v.bp")
104104
with pytest.raises(RuntimeError):
105-
VTXWriter(mesh.comm, filename, [v, w])
105+
VTXWriter(mesh.comm, filename, "w", [v, w])
106106

107107
@pytest.mark.parametrize("simplex", [True, False])
108108
def test_vtx_different_meshes_function(self, tempdir, simplex):
@@ -115,7 +115,7 @@ def test_vtx_different_meshes_function(self, tempdir, simplex):
115115
w = Function(functionspace(mesh2, ("Lagrange", 1)))
116116
filename = Path(tempdir, "v.bp")
117117
with pytest.raises(RuntimeError):
118-
VTXWriter(mesh.comm, filename, [v, w])
118+
VTXWriter(mesh.comm, filename, "w", [v, w])
119119

120120
@pytest.mark.parametrize("dtype", [np.float32, np.float64, np.complex64, np.complex128])
121121
@pytest.mark.parametrize("dim", [2, 3])
@@ -144,7 +144,7 @@ def vel(x):
144144
w.interpolate(lambda x: x[0] + x[1])
145145

146146
filename = Path(tempdir, f"v-{np.dtype(dtype).num}.bp")
147-
f = VTXWriter(mesh.comm, filename, [v, w])
147+
f = VTXWriter(mesh.comm, filename, "w", [v, w])
148148

149149
# Set two cells to 0
150150
for c in [0, 1]:
@@ -174,7 +174,7 @@ def test_save_vtkx_cell_point(self, tempdir):
174174
u.name = "A"
175175

176176
filename = Path(tempdir, "v.bp")
177-
f = VTXWriter(mesh.comm, filename, [u])
177+
f = VTXWriter(mesh.comm, filename, "w", [u])
178178
f.write(0)
179179
f.close()
180180

@@ -206,7 +206,7 @@ def partitioner(comm, nparts, local_graph, num_ghost_nodes):
206206
u = Function(V)
207207

208208
filename = Path(tempdir, "empty_rank_mesh.bp")
209-
with VTXWriter(comm, filename, u) as f:
209+
with VTXWriter(comm, filename, "w", u) as f:
210210
f.write(0.0)
211211

212212
@pytest.mark.parametrize("dim", [2, 3])

0 commit comments

Comments
 (0)