Package: dolfin / 2018.1.0.post1-16

pytest_fixtures_096217a.patch Patch series | 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
From 096217a0a3cb710e869d7e82a3d3609c4d968b76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9cile=20Daversin-Catty?= <cecile@simula.no>
Date: Tue, 20 Nov 2018 11:19:52 +0100
Subject: [PATCH] Pytest fixes - update unit tests to fit with last pytest
 version

---
 python/dolfin_utils/test/fixtures.py               |   5 +-
 python/test/unit/fem/test_dofmap.py                |  16 ++--
 python/test/unit/fem/test_finite_element.py        |   2 +-
 .../unit/fem/test_symbolic_geometry_assembly.py    | 101 ++++++++++++---------
 python/test/unit/function/test_function_space.py   |   4 +-
 python/test/unit/la/test_lu_solver.py              |   2 +-
 python/test/unit/la/test_nullspace.py              |   2 +-
 python/test/unit/mesh/test_mesh.py                 |  14 +--
 .../unit/multimesh/test_multimesh_cell_types.py    |  18 ++--
 python/test/unit/multimesh/test_multimesh_solve.py |  29 +++---
 10 files changed, 109 insertions(+), 84 deletions(-)

diff --git a/python/dolfin_utils/test/fixtures.py b/python/dolfin_utils/test/fixtures.py
index 790aa2f..a39b8aa 100644
--- a/python/dolfin_utils/test/fixtures.py
+++ b/python/dolfin_utils/test/fixtures.py
@@ -82,8 +82,6 @@ def gc_barrier():
     if MPI.size(MPI.comm_world) > 1:
         MPI.barrier(MPI.comm_world)
 
-
-@pytest.fixture
 def worker_id(request):
     """Returns thread id when running with pytest-xdist in parallel."""
     if hasattr(request.config, 'slaveinput'):
@@ -91,6 +89,9 @@ def worker_id(request):
     else:
         return 'master'
 
+@pytest.fixture
+def worker_id_fixture(request):
+    return worker_id(request)
 
 @pytest.yield_fixture(scope="function")
 def gc_barrier_fixture():
diff --git a/python/test/unit/fem/test_dofmap.py b/python/test/unit/fem/test_dofmap.py
index 2689ae5..7bf649d 100644
--- a/python/test/unit/fem/test_dofmap.py
+++ b/python/test/unit/fem/test_dofmap.py
@@ -41,8 +41,8 @@ reorder_dofs = set_parameters_fixture("reorder_dofs_serial", [True, False])
                                           (UnitCubeMesh, (2, 2, 2)),
                                           # cell.contains(Point) does not work correctly
                                           # for quad/hex cells once it is fixed, this test will pass
-                                          xfail((UnitSquareMesh.create, (4, 4, CellType.Type.quadrilateral))),
-                                          xfail((UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron)))])
+                                          pytest.param(((UnitSquareMesh.create, (4, 4, CellType.Type.quadrilateral))), marks=xfail),
+                                          pytest.param(((UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron))), marks=xfail)])
 def test_tabulate_all_coordinates(mesh_factory):
     func, args = mesh_factory
     mesh = func(*args)
@@ -516,16 +516,16 @@ xfail_ffc = pytest.mark.xfail(raises=Exception, strict=True)
     "FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),             'DQ', 2)",
     "FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.triangle),                'N1curl', 1)",
     "FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.tetrahedron),            'N1curl', 1)",
-    xfail_ffc("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'N1curl', 1)"),
-    xfail_ffc("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'N1curl', 1)"),
+    pytest.param(("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'N1curl', 1)"), marks=xfail_ffc),
+    pytest.param(("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'N1curl', 1)"), marks=xfail_ffc),
     "FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.triangle),                'N1curl', 2)",
     "FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.tetrahedron),            'N1curl', 2)",
-    xfail_ffc("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'N1curl', 2)"),
-    xfail_ffc("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'N1curl', 2)"),
+    pytest.param(("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'N1curl', 2)"), marks=xfail_ffc),
+    pytest.param(("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'N1curl', 2)"), marks=xfail_ffc),
     "FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.triangle),                'RT', 1)",
     "FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.tetrahedron),            'RT', 1)",
-    xfail_ffc("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'RT', 1)"),
-    xfail_ffc("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'RT', 1)"),
+    pytest.param(("FunctionSpace(UnitSquareMesh.create(6, 6, CellType.Type.quadrilateral), 'RT', 1)"), marks=xfail_ffc),
+    pytest.param(("FunctionSpace(UnitCubeMesh.create(2, 2, 2, CellType.Type.hexahedron),   'RT', 1)"), marks=xfail_ffc),
 ])
 def test_dofs_dim(space):
     """Test function GenericDofMap::dofs(mesh, dim)"""
diff --git a/python/test/unit/fem/test_finite_element.py b/python/test/unit/fem/test_finite_element.py
index 0693f26..dee876c 100644
--- a/python/test/unit/fem/test_finite_element.py
+++ b/python/test/unit/fem/test_finite_element.py
@@ -34,7 +34,7 @@ xfail = pytest.mark.xfail(strict=True)
                                           (UnitSquareMesh.create, (4, 4, CellType.Type.quadrilateral)),
                                           # cell_normal has not been implemented for hex cell
                                           # cell.orientation() does not work
-                                          xfail((UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron)))])
+                                          pytest.param(((UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron))), marks=xfail)])
 def test_evaluate_dofs(mesh_factory):
 
     func, args = mesh_factory
diff --git a/python/test/unit/fem/test_symbolic_geometry_assembly.py b/python/test/unit/fem/test_symbolic_geometry_assembly.py
index f0597f9..3f89f7b 100644
--- a/python/test/unit/fem/test_symbolic_geometry_assembly.py
+++ b/python/test/unit/fem/test_symbolic_geometry_assembly.py
@@ -107,26 +107,20 @@ intervals.
 
 line_resolution = 8
 
-
-@fixture
-def line1d(request):
+def line1d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(u**2,) for u in us]
     return create_line_mesh(vertices)
 
-
-@fixture
-def rline1d(request):
+def rline1d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(u**2,) for u in us]
     vertices = list(reversed(vertices))  # same as line1d, just reversed here
     return create_line_mesh(vertices)
 
-
-@fixture
-def line2d(request):
+def line2d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(cos(DOLFIN_PI*u), sin(DOLFIN_PI*u)) for u in us]
@@ -134,9 +128,7 @@ def line2d(request):
     mesh.init_cell_orientations(Expression(("0.0", "1.0"), degree=0))
     return mesh
 
-
-@fixture
-def rline2d(request):
+def rline2d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(cos(DOLFIN_PI*u), sin(DOLFIN_PI*u)) for u in us]
@@ -145,9 +137,7 @@ def rline2d(request):
     mesh.init_cell_orientations(Expression(("0.0", "1.0"), degree=0))
     return mesh
 
-
-@fixture
-def line3d(request):
+def line3d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(cos(4.0*DOLFIN_PI*u),
@@ -156,9 +146,7 @@ def line3d(request):
     mesh = create_line_mesh(vertices)
     return mesh
 
-
-@fixture
-def rline3d(request):
+def rline3d_impl(request):
     n = line_resolution
     us = [i/float(n-1) for i in range(n)]
     vertices = [(cos(4.0*DOLFIN_PI*u),
@@ -168,9 +156,7 @@ def rline3d(request):
     mesh = create_line_mesh(vertices)
     return mesh
 
-
-@fixture
-def square2d(request):
+def square2d_impl(request):
     cellname = "triangle"
     side = sqrt(sqrt(3.0))
     vertices = [
@@ -186,9 +172,7 @@ def square2d(request):
     mesh = create_mesh(vertices, cells)
     return mesh
 
-
-@fixture
-def square3d(request):
+def square3d_impl(request):
     cellname = "triangle"
     vertices = [
         (0.0, 0.0, 1.0),
@@ -205,6 +189,37 @@ def square3d(request):
 
     return mesh
 
+@fixture
+def line1d(request):
+    return line1d_impl(request)
+
+@fixture
+def rline1d(request):
+    return rline1d_impl(request)
+
+@fixture
+def line2d(request):
+    return line2d_impl(request)
+
+@fixture
+def rline2d(request):
+    return rline2d_impl(request)
+
+@fixture
+def line3d(request):
+    return line3d_impl(request)
+
+@fixture
+def rline3d(request):
+    return rline3d_impl(request)
+
+@fixture
+def square2d(request):
+    return square2d_impl(request)
+
+@fixture
+def square3d(request):
+    return square3d_impl(request)
 
 @skip_in_parallel
 def test_line_meshes(line1d, line2d, line3d, rline1d, rline2d, rline3d):
@@ -238,14 +253,14 @@ def test_write_line_meshes_to_files(line1d, line2d, line3d, rline1d, rline2d,
                                                                   "DG", 0))
 
 
-@skip_in_parallel
 @pytest.mark.parametrize("mesh", [
-    line1d(None),
-    line2d(None),
-    line3d(None),
-    rline1d(None),
-    rline2d(None),
-    rline3d(None), ])
+    line1d_impl(None),
+    line2d_impl(None),
+    line3d_impl(None),
+    rline1d_impl(None),
+    rline2d_impl(None),
+    rline3d_impl(None), ])
+@skip_in_parallel
 def test_manifold_line_geometry(mesh, uflacs_representation_only):
     assert uflacs_representation_only == "uflacs"
     assert parameters["form_compiler"]["representation"] == "uflacs"
@@ -907,21 +922,21 @@ xfail_jit = pytest.mark.xfail(raises=Exception, strict=True)
     (UnitCubeMesh, (2, 2, 2)),
     (UnitSquareMesh.create, (4, 4, CellType.Type.quadrilateral)),
     (UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron)),
-    (line1d, (None,)),
-    (line2d, (None,)),
-    (line3d, (None,)),
-    (rline1d, (None,)),
-    (rline2d, (None,)),
-    (rline3d, (None,)),
-    (square2d, (None,)),
-    (square3d, (None,)),
+    (line1d_impl, (None,)),
+    (line2d_impl, (None,)),
+    (line3d_impl, (None,)),
+    (rline1d_impl, (None,)),
+    (rline2d_impl, (None,)),
+    (rline3d_impl, (None,)),
+    (square2d_impl, (None,)),
+    (square3d_impl, (None,)),
     # Tested geometric quantities are not implemented for higher-order cells
-    xfail_jit((UnitDiscMesh.create, (MPI.comm_world, 4, 2, 2))),
-    xfail_jit((UnitDiscMesh.create, (MPI.comm_world, 4, 2, 3))),
-    xfail_jit((SphericalShellMesh.create, (MPI.comm_world, 2,))),
-])
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 4, 2, 2))), marks=xfail_jit),
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 4, 2, 3))), marks=xfail_jit),
+    pytest.param(((SphericalShellMesh.create, (MPI.comm_world, 2,))), marks=xfail_jit)])
 @skip_in_parallel
 def test_geometric_quantities(uflacs_representation_only, mesh_factory):
+
     func, args = mesh_factory
     mesh = func(*args)
 
diff --git a/python/test/unit/function/test_function_space.py b/python/test/unit/function/test_function_space.py
index 3c97227..66cfe0e 100755
--- a/python/test/unit/function/test_function_space.py
+++ b/python/test/unit/function/test_function_space.py
@@ -165,13 +165,13 @@ def test_sub_equality(W, Q):
     assert Q.sub(0) == Q.extract_sub_space([0])
 
 
-def test_in_operator(f, g, V, V2, W, W2):
+def test_in_operator(f, g, V, V2, W, W2, mesh):
     assert f in V
     assert f in V2
     assert g in W
     assert g in W2
     with pytest.raises(RuntimeError):
-        mesh() in V
+        mesh in V
 
 
 def test_collapse(W, V):
diff --git a/python/test/unit/la/test_lu_solver.py b/python/test/unit/la/test_lu_solver.py
index aed2762..82790e9 100755
--- a/python/test/unit/la/test_lu_solver.py
+++ b/python/test/unit/la/test_lu_solver.py
@@ -21,7 +21,7 @@ from dolfin import *
 import pytest
 from dolfin_utils.test import skip_if_not_PETSc, skip_in_parallel
 
-backends = ["PETSc", skip_in_parallel("Eigen")]
+backends = ["PETSc", pytest.param(("Eigen"), marks=skip_in_parallel)]
 
 @pytest.mark.parametrize('backend', backends)
 def test_lu_solver(backend):
diff --git a/python/test/unit/la/test_nullspace.py b/python/test/unit/la/test_nullspace.py
index e60680a..a406947 100755
--- a/python/test/unit/la/test_nullspace.py
+++ b/python/test/unit/la/test_nullspace.py
@@ -21,7 +21,7 @@ from dolfin import *
 import pytest
 from dolfin_utils.test import *
 
-backends = ["PETSc", skip_in_parallel("Eigen")]
+backends = ["PETSc", pytest.param(("Eigen"), marks=skip_in_parallel)]
 
 def build_elastic_nullspace(V, x):
     """Function to build nullspace for 2D/3D elasticity"""
diff --git a/python/test/unit/mesh/test_mesh.py b/python/test/unit/mesh/test_mesh.py
index af7a3ad..d33673c 100644
--- a/python/test/unit/mesh/test_mesh.py
+++ b/python/test/unit/mesh/test_mesh.py
@@ -557,16 +557,16 @@ mesh_factories_broken_shared_entities = [
     (UnitIntervalMesh, (8,)),
     (UnitSquareMesh, (4, 4)),
     # FIXME: Problem in test_shared_entities
-    xfail_in_parallel((UnitDiscMesh.create, (MPI.comm_world, 10, 1, 2))),
-    xfail_in_parallel((UnitDiscMesh.create, (MPI.comm_world, 10, 2, 2))),
-    xfail_in_parallel((UnitDiscMesh.create, (MPI.comm_world, 10, 1, 3))),
-    xfail_in_parallel((UnitDiscMesh.create, (MPI.comm_world, 10, 2, 3))),
-    xfail_in_parallel((SphericalShellMesh.create, (MPI.comm_world, 1,))),
-    xfail_in_parallel((SphericalShellMesh.create, (MPI.comm_world, 2,))),
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 10, 1, 2))), marks=xfail_in_parallel),
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 10, 2, 2))), marks=xfail_in_parallel),
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 10, 1, 3))), marks=xfail_in_parallel),
+    pytest.param(((UnitDiscMesh.create, (MPI.comm_world, 10, 2, 3))), marks=xfail_in_parallel),
+    pytest.param(((SphericalShellMesh.create, (MPI.comm_world, 1,))), marks=xfail_in_parallel),
+    pytest.param(((SphericalShellMesh.create, (MPI.comm_world, 2,))), marks=xfail_in_parallel),
     (UnitCubeMesh, (2, 2, 2)),
     (UnitSquareMesh.create, (4, 4, CellType.Type.quadrilateral)),
     (UnitCubeMesh.create, (2, 2, 2, CellType.Type.hexahedron)),
-    xfail_in_parallel((create_two_good_quads, ())),
+    pytest.param(((create_two_good_quads, ())), marks=xfail_in_parallel),
 ]
 
 # FIXME: Fix this xfail
diff --git a/python/test/unit/multimesh/test_multimesh_cell_types.py b/python/test/unit/multimesh/test_multimesh_cell_types.py
index 76599f1..64ef136 100644
--- a/python/test/unit/multimesh/test_multimesh_cell_types.py
+++ b/python/test/unit/multimesh/test_multimesh_cell_types.py
@@ -25,8 +25,7 @@ import pytest
 from dolfin_utils.test import skip_in_parallel
 
 # test case with interface-edge overlap
-@pytest.fixture
-def test_case_1(M, N):
+def case_1_impl(M, N):
     multimesh = MultiMesh()
     mesh0 = UnitSquareMesh(M, M)
     mesh1 = RectangleMesh(Point(0.25, 0.25), Point(0.75, 0.75), N, N)
@@ -36,8 +35,7 @@ def test_case_1(M, N):
     return multimesh
 
 # test case with squares on the diagonal
-@pytest.fixture
-def test_case_2(width, offset, Nx):
+def case_2_impl(width, offset, Nx):
 
     # Mesh width (must be less than 1)
     assert width < 1
@@ -65,8 +63,16 @@ def test_case_2(width, offset, Nx):
     multimesh.build()
     return multimesh
 
-test_cases = [test_case_1(4,3),
-              test_case_2(DOLFIN_PI/5, 0.1111, 3)]
+@pytest.fixture
+def case_1(M, N):
+    return case_1_impl(M,N)
+
+@pytest.fixture
+def case_2(width, offset, Nx):
+    return case_2_impl(width, offset, Nx)
+
+test_cases = [case_1_impl(4,3),
+              case_2_impl(DOLFIN_PI/5, 0.1111, 3)]
 
 @skip_in_parallel
 @pytest.mark.parametrize("multimesh", test_cases)
diff --git a/python/test/unit/multimesh/test_multimesh_solve.py b/python/test/unit/multimesh/test_multimesh_solve.py
index 4530505..5edad0f 100644
--- a/python/test/unit/multimesh/test_multimesh_solve.py
+++ b/python/test/unit/multimesh/test_multimesh_solve.py
@@ -25,17 +25,13 @@ from dolfin import *
 
 from dolfin_utils.test import skip_in_parallel, fixture
 
-@fixture
-def exactsolution_2d():
+def exactsolution_2d_impl():
     return Expression("x[0] + x[1]", degree=1)
 
-@fixture
-def exactsolution_3d():
+def exactsolution_3d_impl():
     return Expression("x[0] + x[1] + x[2]", degree=1)
 
-@fixture
 def solve_multimesh_poisson(mesh_0, mesh_1, exactsolution):
-
     # Build multimesh
     multimesh = MultiMesh()
     multimesh.add(mesh_0)
@@ -81,9 +77,17 @@ def solve_multimesh_poisson(mesh_0, mesh_1, exactsolution):
 
     return uh
 
+@fixture
+def exactsolution_2d():
+    return exactsolution_2d_impl()
+
+@fixture
+def exactsolution_3d():
+    return exactsolution_3d_impl()
+
 @pytest.mark.slow
 @skip_in_parallel
-def test_multimesh_poisson_2d():
+def test_multimesh_poisson_2d(exactsolution_2d):
     # This tests solves a Poisson problem on two meshes in 2D with u =
     # x+y as exact solution
 
@@ -94,18 +98,17 @@ def test_multimesh_poisson_2d():
     mesh_1 = RectangleMesh(Point(0.1*DOLFIN_PI, 0.1*DOLFIN_PI),
                            Point(0.2*DOLFIN_PI, 0.2*DOLFIN_PI),
                            2, 2)
-
     # Solve multimesh Poisson
-    uh = solve_multimesh_poisson(mesh_0, mesh_1, exactsolution_2d())
+    uh = solve_multimesh_poisson(mesh_0, mesh_1, exactsolution_2d)
 
     # Check error
-    assert errornorm(exactsolution_2d(), uh, 'L2', degree_rise=1) < DOLFIN_EPS_LARGE
+    assert errornorm(exactsolution_2d, uh, 'L2', degree_rise=1) < DOLFIN_EPS_LARGE
 
 @pytest.mark.slow
 @pytest.mark.skip
 @skip_in_parallel
 @pytest.mark.skipif(True, reason="3D not fully implemented")
-def test_multimesh_poisson_3d():
+def test_multimesh_poisson_3d(exactsolution_3d):
     # This tests solves a Poisson problem on two meshes in 3D with u =
     # x+y+z as exact solution
 
@@ -118,7 +121,7 @@ def test_multimesh_poisson_3d():
                      2, 2, 2)
 
     # Solve multimesh Poisson
-    uh = solve_multimesh_poisson(mesh_0, mesh_1, exactsolution_3d())
+    uh = solve_multimesh_poisson(mesh_0, mesh_1, exactsolution_3d)
 
     # Check error
-    assert errornorm(exactsolution_3d(), uh, 'L2', degree_rise=1) < DOLFIN_EPS_LARGE
+    assert errornorm(exactsolution_3d, uh, 'L2', degree_rise=1) < DOLFIN_EPS_LARGE
-- 
2.10.5