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

Function test_close

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

Source from the content-addressed store, hash-verified

182
183@pytest.mark.asyncio
184async def test_close(lock_file: str) -> None:
185 lock = AsyncReadWriteLock(lock_file, is_singleton=False)
186 await lock.acquire_write()
187 assert lock._lock._lock_level == 1
188 await lock.close()
189 assert lock._lock._lock_level == 0
190 with pytest.raises(sqlite3.ProgrammingError, match="Cannot operate on a closed database"):
191 lock._lock._con.execute("SELECT 1;")
192
193
194@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 4

acquire_writeMethod · 0.95
closeMethod · 0.95
AsyncReadWriteLockClass · 0.90
executeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…