|
6 | 6 |
|
7 | 7 |
|
8 | 8 | @pytest.fixture(autouse=True) |
9 | | -def handle_taping(): |
10 | | - yield |
11 | | - tape = get_working_tape() |
12 | | - tape.clear_tape() |
13 | | - |
14 | | - |
15 | | -@pytest.fixture(autouse=True, scope="module") |
16 | | -def handle_annotation(): |
17 | | - if not annotate_tape(): |
18 | | - continue_annotation() |
19 | | - yield |
20 | | - # Ensure annotation is paused when we finish. |
21 | | - if annotate_tape(): |
22 | | - pause_annotation() |
| 9 | +def autouse_set_test_tape(set_test_tape): |
| 10 | + pass |
23 | 11 |
|
24 | 12 |
|
25 | 13 | @pytest.mark.skipcomplex |
26 | | -@pytest.mark.parametrize("mesh", [UnitSquareMesh(10, 10)]) |
27 | | -def test_dynamic_meshes_2D(mesh): |
| 14 | +def test_dynamic_meshes_2D(): |
| 15 | + mesh = UnitSquareMesh(10, 10) |
28 | 16 | S = mesh.coordinates.function_space() |
29 | 17 | s = [Function(S), Function(S), Function(S)] |
30 | 18 | mesh.coordinates.assign(mesh.coordinates + s[0]) |
@@ -71,13 +59,26 @@ def test_dynamic_meshes_2D(mesh): |
71 | 59 |
|
72 | 60 |
|
73 | 61 | @pytest.mark.skipcomplex |
74 | | -@pytest.mark.parametrize("mesh", [UnitCubeMesh(4, 4, 5), |
75 | | - UnitOctahedralSphereMesh(3), |
76 | | - UnitIcosahedralSphereMesh(3), |
77 | | - UnitCubedSphereMesh(3), |
78 | | - TorusMesh(25, 10, 1, 0.5), |
79 | | - CylinderMesh(10, 25, radius=0.5, depth=0.8)]) |
80 | | -def test_dynamic_meshes_3D(mesh): |
| 62 | +@pytest.mark.parametrize("mesh_type", ["UnitCubeMesh", |
| 63 | + "UnitOctahedralSphereMesh", |
| 64 | + "UnitIcosahedralSphereMesh", |
| 65 | + "UnitCubedSphereMesh", |
| 66 | + "TorusMesh", |
| 67 | + "CylinderMesh"]) |
| 68 | +def test_dynamic_meshes_3D(mesh_type): |
| 69 | + if mesh_type == "UnitCubeMesh": |
| 70 | + mesh = UnitCubeMesh(4, 4, 5) |
| 71 | + if mesh_type == "UnitOctahedralSphereMesh": |
| 72 | + mesh = UnitOctahedralSphereMesh(3) |
| 73 | + if mesh_type == "UnitIcosahedralSphereMesh": |
| 74 | + mesh = UnitIcosahedralSphereMesh(3) |
| 75 | + if mesh_type == "UnitCubedSphereMesh": |
| 76 | + mesh = UnitCubedSphereMesh(3) |
| 77 | + if mesh_type == "TorusMesh": |
| 78 | + mesh = TorusMesh(25, 10, 1, 0.5) |
| 79 | + if mesh_type == "CylinderMesh": |
| 80 | + mesh = CylinderMesh(10, 25, radius=0.5, depth=0.8) |
| 81 | + |
81 | 82 | S = mesh.coordinates.function_space() |
82 | 83 | s = [Function(S), Function(S), Function(S)] |
83 | 84 | mesh.coordinates.assign(mesh.coordinates + s[0]) |
|
0 commit comments