Skip to content

Commit c94308d

Browse files
committed
Add unit test that ensures _derive_block_jacobian doesn't break with bad second argument. Clean up import no longer needed.
1 parent eafb506 commit c94308d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

python/test/unit/fem/test_forms.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
from dolfinx.mesh import create_unit_square
2020
from ufl import Measure, SpatialCoordinate, TestFunction, TrialFunction, dx, inner, Form as ufl_form, TrialFunctions, TestFunctions, MixedFunctionSpace
2121

22-
from collections.abc import Sequence
23-
2422

2523
def test_extract_forms():
2624
"""Test extraction on unique function spaces for rows and columns of
@@ -171,6 +169,9 @@ def test_derivative_block():
171169
F_block = derivative_block(M_block, [f0, f1], [v0, v1])
172170
assert all([isinstance(F_i, ufl_form) and len(F_i.arguments()) == 1 for F_i in F_block])
173171

172+
with pytest.raises(ValueError):
173+
derivative_block(F_block, f0) # second argument not a sequence
174+
174175
with pytest.raises(ValueError):
175176
derivative_block(F_block, [f0, f1], [u0]) # third argument has wrong length
176177

0 commit comments

Comments
 (0)