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

Function _clear_singleton_cache

tests/test_read_write_unit.py:33–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31
32@pytest.fixture(autouse=True)
33def _clear_singleton_cache() -> Generator[None]:
34 ReadWriteLock._instances.clear()
35 yield
36 for instance in list(ReadWriteLock._instances.valuerefs()):
37 if (lock := instance()) is not None: # pragma: no cover # cache is normally emptied before teardown
38 lock.close()
39 ReadWriteLock._instances.clear()
40
41
42@pytest.fixture

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected