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

Function _clear_singleton_cache

tests/test_async_read_write.py:23–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22@pytest.fixture(autouse=True)
23def _clear_singleton_cache() -> Generator[None]:
24 ReadWriteLock._instances.clear()
25 yield
26 for ref in list(ReadWriteLock._instances.valuerefs()):
27 if (lock := ref()) is not None: # pragma: no cover # cache is normally emptied before teardown
28 lock.close()
29 ReadWriteLock._instances.clear()
30
31
32@pytest.fixture

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected