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

Function test_custom_executor

tests/sqlite/test_async_executor.py:78–85  ·  view source on GitHub ↗
(lock_file: str)

Source from the content-addressed store, hash-verified

76
77@pytest.mark.asyncio
78async def test_custom_executor(lock_file: str) -> None:
79 executor = ThreadPoolExecutor(max_workers=1)
80 lock = AsyncReadWriteLock(lock_file, is_singleton=False, executor=executor)
81 async with lock.read_lock():
82 assert_mode_held(lock_file, "read")
83 with pytest.raises(RuntimeError, match="not held"):
84 await lock.release()
85 executor.shutdown(wait=False)
86
87
88@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

read_lockMethod · 0.95
AsyncReadWriteLockClass · 0.90
assert_mode_heldFunction · 0.90
releaseMethod · 0.45

Tested by

no test coverage detected