Skip to content

Commit

Permalink
Remove pytest cache clearing (#375)
Browse files Browse the repository at this point in the history
Cache clearing no longer needed with recent Firedrake/PyOP2 updates
  • Loading branch information
cpjordan authored Nov 12, 2024
1 parent 9150d9f commit 8c6f9d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
10 changes: 0 additions & 10 deletions test/conftest.py

This file was deleted.

9 changes: 1 addition & 8 deletions test_adjoint/conftest.py
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()

0 comments on commit 8c6f9d1

Please sign in to comment.