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

Function test_context_decorator

tests/test_filelock.py:578–588  ·  view source on GitHub ↗
(lock_type: type[BaseFileLock], tmp_path: Path)

Source from the content-addressed store, hash-verified

576
577@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
578def test_context_decorator(lock_type: type[BaseFileLock], tmp_path: Path) -> None:
579 lock_path = tmp_path / "a"
580 lock = lock_type(str(lock_path))
581
582 @lock
583 def decorated_method() -> None:
584 assert lock.is_locked
585
586 assert not lock.is_locked
587 decorated_method()
588 assert not lock.is_locked
589
590
591def test_lock_mode(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 1

decorated_methodFunction · 0.85

Tested by

no test coverage detected