-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cache clearing no longer needed with recent Firedrake/PyOP2 updates
- Loading branch information
Showing
2 changed files
with
1 addition
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |