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

Function test_nested_contruct

tests/core/test_lock.py:236–248  ·  view source on GitHub ↗
(lock_type: type[BaseFileLock], tmp_path: Path)

Source from the content-addressed store, hash-verified

234
235@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
236def test_nested_contruct(lock_type: type[BaseFileLock], tmp_path: Path) -> None:
237 lock_path = tmp_path / "a"
238
239 with lock_type(str(lock_path), is_singleton=True, timeout=2) as lock_1:
240 assert lock_1.is_locked
241
242 with lock_type(str(lock_path), is_singleton=True, timeout=2) as lock_2:
243 assert lock_2 is lock_1
244 assert lock_2.is_locked
245
246 assert lock_1.is_locked
247
248 assert not lock_1.is_locked
249
250
251@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])

Callers

nothing calls this directly

Calls 1

lock_typeFunction · 0.85

Tested by

no test coverage detected