From 8c6f9d1ed954a05a8d1013f79ab5b7a702c9a4a2 Mon Sep 17 00:00:00 2001 From: Connor Jordan <115144692+cpjordan@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:29:56 +0000 Subject: [PATCH] Remove pytest cache clearing (#375) Cache clearing no longer needed with recent Firedrake/PyOP2 updates --- test/conftest.py | 10 ---------- test_adjoint/conftest.py | 9 +-------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 test/conftest.py diff --git a/test/conftest.py b/test/conftest.py deleted file mode 100644 index b807d1d13..000000000 --- a/test/conftest.py +++ /dev/null @@ -1,10 +0,0 @@ -def pytest_runtest_teardown(item, nextitem): - """Clear Thetis caches after running a test""" - from firedrake.tsfc_interface import TSFCKernel - from pyop2.global_kernel import GlobalKernel - - # disgusting hack, clear the Class-Cached objects in PyOP2 and - # Firedrake, otherwise these will never be collected. The Kernels - # get very big with bendy on. - TSFCKernel._cache.clear() - GlobalKernel._cache.clear() diff --git a/test_adjoint/conftest.py b/test_adjoint/conftest.py index c08371dcf..3e4f20137 100644 --- a/test_adjoint/conftest.py +++ b/test_adjoint/conftest.py @@ -1,15 +1,8 @@ def pytest_runtest_teardown(item, nextitem): - """Clear Thetis caches after running a test""" - from firedrake.tsfc_interface import TSFCKernel - from pyop2.global_kernel import GlobalKernel + """Clear adjoint tape after running a test""" from pyadjoint import get_working_tape - # disgusting hack, clear the Class-Cached objects in PyOP2 and - # Firedrake, otherwise these will never be collected. The Kernels - # get very big with bendy on. - TSFCKernel._cache.clear() - GlobalKernel._cache.clear() # clear the adjoint tape, so subsequent tests don't interfere get_working_tape().clear_tape()