diff --git a/tests/firedrake/output/test_adjoint_disk_checkpointing.py b/tests/firedrake/output/test_adjoint_disk_checkpointing.py index 2f4b15e9f7..c1cf3daaa0 100644 --- a/tests/firedrake/output/test_adjoint_disk_checkpointing.py +++ b/tests/firedrake/output/test_adjoint_disk_checkpointing.py @@ -104,6 +104,6 @@ def test_disk_checkpointing_successive_writes(): J = assemble(v*dx) Jhat = ReducedFunctional(J, Control(u)) - assert np.allclose(J, Jhat(1)) + assert np.allclose(J, Jhat(Function(cg_space).interpolate(1.))) pause_disk_checkpointing() tape.clear_tape() diff --git a/tests/firedrake/regression/test_adjoint_operators.py b/tests/firedrake/regression/test_adjoint_operators.py index a8f5149657..8d4c0ab796 100644 --- a/tests/firedrake/regression/test_adjoint_operators.py +++ b/tests/firedrake/regression/test_adjoint_operators.py @@ -717,7 +717,7 @@ def test_init_constant(): c2.assign(c1) J = assemble(c2*dx(domain=mesh)) rf = ReducedFunctional(J, Control(c1)) - assert np.isclose(rf(-1.0), -1.0) + assert np.isclose(rf(Function(R, val=-1.0)), -1.0) @pytest.mark.skipcomplex # Taping for complex-valued 0-forms not yet done