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

Function async_locks

tests/sqlite/test_async_settings.py:203–220  ·  view source on GitHub ↗
(
    tmp_path: Path, instance_timeout: float, *, instance_blocking: bool, shared: bool
)

Source from the content-addressed store, hash-verified

201
202@pytest_asyncio.fixture(loop_scope="function") # Join shutdown workers before later fork tests.
203async def async_locks(
204 tmp_path: Path, instance_timeout: float, *, instance_blocking: bool, shared: bool
205) -> AsyncIterator[tuple[AsyncReadWriteLock, AsyncReadWriteLock]]:
206 holder: Final[AsyncReadWriteLock] = AsyncReadWriteLock(
207 tmp_path / "a", timeout=instance_timeout, blocking=instance_blocking, is_singleton=False
208 )
209 contender: Final[AsyncReadWriteLock] = (
210 holder
211 if shared
212 else AsyncReadWriteLock(
213 tmp_path / "a", timeout=instance_timeout, blocking=instance_blocking, is_singleton=False
214 )
215 )
216 try:
217 yield holder, contender
218 finally:
219 await holder.close()
220 await contender.close()

Callers

nothing calls this directly

Calls 2

AsyncReadWriteLockClass · 0.90
closeMethod · 0.45

Tested by

no test coverage detected