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

Function assert_mode_held

tests/test_async_read_write.py:291–296  ·  view source on GitHub ↗
(lock_file: str, mode: Literal["read", "write"])

Source from the content-addressed store, hash-verified

289
290
291def assert_mode_held(lock_file: str, mode: Literal["read", "write"]) -> None:
292 contender = ReadWriteLock(lock_file, is_singleton=False)
293 acquire = contender.acquire_write if mode == "read" else contender.acquire_read
294 with pytest.raises(Timeout):
295 acquire(blocking=False)
296 contender.close()

Calls 3

closeMethod · 0.95
ReadWriteLockClass · 0.90
acquireFunction · 0.70

Tested by

no test coverage detected