Skip to content

Commit 61cb5f2

Browse files
committed
Only call continue_annotation once in test so stop_annotating works as expected
1 parent 7e13000 commit 61cb5f2

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

tests/vertexonly/test_poisson_inverse_conductivity.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pytest
22
import numpy as np
33
from firedrake import *
4-
from pyadjoint.tape import get_working_tape, pause_annotation, continue_annotation, set_working_tape
4+
from pyadjoint.tape import get_working_tape, pause_annotation
55

66

77
@pytest.fixture(autouse=True)
@@ -29,12 +29,6 @@ def test_poisson_inverse_conductivity():
2929
# Have to import inside test to make sure cleanup fixtures work as intended
3030
from firedrake_adjoint import Control, ReducedFunctional, minimize
3131

32-
# Manually set up annotation since test suite may have stopped it
33-
tape = get_working_tape()
34-
tape.clear_tape()
35-
set_working_tape(tape)
36-
continue_annotation()
37-
3832
# Use pyadjoint to estimate an unknown conductivity in a
3933
# poisson-like forward model from point measurements
4034
m = UnitSquareMesh(2, 2)
@@ -98,7 +92,3 @@ def test_poisson_inverse_conductivity():
9892

9993
# Estimate q using Newton-CG which evaluates the hessian action
10094
minimize(, method='Newton-CG', options={'disp': True})
101-
102-
# Make sure annotation is stopped
103-
tape.clear_tape()
104-
pause_annotation()

0 commit comments

Comments
 (0)