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

Function test_context_decorator

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

Source from the content-addressed store, hash-verified

557
558@pytest.mark.parametrize("lock_type", [FileLock, SoftFileLock])
559def test_context_decorator(lock_type: type[BaseFileLock], tmp_path: Path) -> None:
560 lock_path = tmp_path / "a"
561 lock = lock_type(str(lock_path))
562
563 @lock
564 def decorated_method() -> None:
565 assert lock.is_locked
566
567 assert not lock.is_locked
568 decorated_method()
569 assert not lock.is_locked
570
571
572def test_lock_mode(tmp_path: Path) -> None:

Callers

nothing calls this directly

Calls 1

decorated_methodFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…