From 73e38f49a8dfa82dfb86b302912b8d9ee28abbbe Mon Sep 17 00:00:00 2001 From: ddundo Date: Mon, 14 Oct 2024 21:10:39 +0000 Subject: [PATCH] #222: Fix pyop2 cache clear --- test/conftest.py | 5 ++--- test_adjoint/conftest.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 17c5be5..f4f789c 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -21,9 +21,8 @@ def pytest_runtest_teardown(item, nextitem): """ Clear caches after running a test """ - # TODO #222: GlobalKernel no longer has _cache attribute from firedrake.tsfc_interface import clear_cache - # from pyop2.global_kernel import GlobalKernel + from pyop2.caching import clear_memory_cache clear_cache() - # GlobalKernel._cache.clear() + clear_memory_cache() diff --git a/test_adjoint/conftest.py b/test_adjoint/conftest.py index 9fd783c..4bf98e4 100644 --- a/test_adjoint/conftest.py +++ b/test_adjoint/conftest.py @@ -135,12 +135,11 @@ def pytest_runtest_teardown(item, nextitem): """ Clear caches after running a test """ - # TODO #222: GlobalKernel no longer has _cache attribute from firedrake.tsfc_interface import clear_cache - # from pyop2.global_kernel import GlobalKernel + from pyop2.caching import clear_memory_cache clear_cache() - # GlobalKernel._cache.clear() + clear_memory_cache() @pytest.fixture(autouse=True)