MCPcopy Create free account
hub / github.com/tox-dev/filelock / clear_sqlite_singletons

Function clear_sqlite_singletons

tests/sqlite/conftest.py:52–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51@pytest.fixture
52def clear_sqlite_singletons() -> Generator[None]:
53 ReadWriteLock._instances.clear()
54 yield
55 for instance in list(ReadWriteLock._instances.valuerefs()):
56 if (lock := instance()) is not None: # pragma: no cover # cache is normally emptied before teardown
57 lock.close()
58 ReadWriteLock._instances.clear()
59
60
61@pytest.fixture(

Callers

nothing calls this directly

Calls 2

clearMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected