Skip to content

Commit

Permalink
#222: Fix cache error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ddundo committed Oct 14, 2024
1 parent f7a3b11 commit ac2908e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ def pytest_runtest_teardown(item, nextitem):
from firedrake.tsfc_interface import TSFCKernel
from pyop2.global_kernel import GlobalKernel

TSFCKernel._cache.clear()
GlobalKernel._cache.clear()
if hasattr(TSFCKernel, "_cache"):
TSFCKernel._cache.clear()
if hasattr(GlobalKernel, "_cache"):
GlobalKernel._cache.clear()
6 changes: 4 additions & 2 deletions test_adjoint/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ def pytest_runtest_teardown(item, nextitem):
from firedrake.tsfc_interface import TSFCKernel
from pyop2.global_kernel import GlobalKernel

TSFCKernel._cache.clear()
GlobalKernel._cache.clear()
if hasattr(TSFCKernel, "_cache"):
TSFCKernel._cache.clear()
if hasattr(GlobalKernel, "_cache"):
GlobalKernel._cache.clear()


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit ac2908e

Please sign in to comment.