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

Function test_custom_executor

tests/test_async_read_write.py:185–192  ·  view source on GitHub ↗
(lock_file: str)

Source from the content-addressed store, hash-verified

183
184@pytest.mark.asyncio
185async def test_custom_executor(lock_file: str) -> None:
186 executor = ThreadPoolExecutor(max_workers=1)
187 lock = AsyncReadWriteLock(lock_file, is_singleton=False, executor=executor)
188 async with lock.read_lock():
189 assert_mode_held(lock_file, "read")
190 with pytest.raises(RuntimeError, match="not held"):
191 await lock.release()
192 executor.shutdown(wait=False)
193
194
195@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

read_lockMethod · 0.95
releaseMethod · 0.95
AsyncReadWriteLockClass · 0.90
assert_mode_heldFunction · 0.85

Tested by

no test coverage detected