diff --git a/test/conftest.py b/test/conftest.py index bb45c5c..3675a4e 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -21,8 +21,9 @@ def pytest_runtest_teardown(item, nextitem): """ Clear caches after running a test """ - from firedrake.tsfc_interface import TSFCKernel - from pyop2.global_kernel import GlobalKernel + from firedrake.tsfc_interface import clear_cache + from pyop2.caching import clear_memory_cache + from pyop2.mpi import COMM_WORLD - TSFCKernel._cache.clear() - GlobalKernel._cache.clear() + clear_cache() + clear_memory_cache(COMM_WORLD) diff --git a/test_adjoint/conftest.py b/test_adjoint/conftest.py index 8a582c5..daf0543 100644 --- a/test_adjoint/conftest.py +++ b/test_adjoint/conftest.py @@ -135,11 +135,12 @@ def pytest_runtest_teardown(item, nextitem): """ Clear caches after running a test """ - from firedrake.tsfc_interface import TSFCKernel - from pyop2.global_kernel import GlobalKernel + from firedrake.tsfc_interface import clear_cache + from pyop2.caching import clear_memory_cache + from pyop2.mpi import COMM_WORLD - TSFCKernel._cache.clear() - GlobalKernel._cache.clear() + clear_cache() + clear_memory_cache(COMM_WORLD) @pytest.fixture(autouse=True)