From 4bb4e3b52fd9bd712842e78e64fc86ef1cce0363 Mon Sep 17 00:00:00 2001 From: "James R. Maddison" Date: Fri, 12 Jul 2024 15:02:45 +0100 Subject: [PATCH] Fix context manager --- tests/regression/test_adjoint_reverse_over_forward.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/regression/test_adjoint_reverse_over_forward.py b/tests/regression/test_adjoint_reverse_over_forward.py index 89ac7b8384..00c7d4530e 100644 --- a/tests/regression/test_adjoint_reverse_over_forward.py +++ b/tests/regression/test_adjoint_reverse_over_forward.py @@ -22,9 +22,11 @@ def _(): def reverse_over_forward(): continue_annotation() continue_reverse_over_forward() - yield - pause_annotation() - pause_reverse_over_forward() + try: + yield + finally: + pause_annotation() + pause_reverse_over_forward() @pytest.mark.skipcomplex