Skip to content

Commit 5252420

Browse files
finsbergjorgensd
andauthored
Update tests/test_legacy_readers.py
Co-authored-by: Jørgen Schartum Dokken <dokken@simula.no>
1 parent a1621e7 commit 5252420

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tests/test_legacy_readers.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,8 @@ def test_read_legacy_function_from_checkpoint(backend):
153153
f = ufl.conditional(ufl.gt(x[0], 0.5), x[1], 2 * x[0])
154154
L = ufl.inner(f, v) * ufl.dx
155155

156-
try:
157-
from dolfinx.fem.petsc import LinearProblem
158-
except ImportError:
159-
pytest.skip("dolfinx.fem.petsc.LinearProblem not available")
156+
if not dolfinx.has_petsc4py:
157+
pytest.skip("dolfinx not configured with PETSc4py")
160158

161159
uh = dolfinx.fem.Function(V)
162160
if "petsc_options_prefix" in inspect.signature(LinearProblem.__init__).parameters.keys():

0 commit comments

Comments
 (0)