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

Function test_wrong_platform

tests/test_filelock.py:657–668  ·  view source on GitHub ↗
(tmp_path: Path)

Source from the content-addressed store, hash-verified

655
656
657def test_wrong_platform(tmp_path: Path) -> None:
658 assert not inspect.isabstract(UnixFileLock)
659 assert not inspect.isabstract(WindowsFileLock)
660 assert inspect.isabstract(BaseFileLock)
661
662 lock_type = UnixFileLock if sys.platform == "win32" else WindowsFileLock
663 lock = lock_type(tmp_path / "lockfile")
664
665 with pytest.raises(NotImplementedError):
666 lock.acquire()
667 with pytest.raises(NotImplementedError):
668 lock._release()
669
670
671@NEEDS_FCNTL # pragma: needs fcntl

Callers

nothing calls this directly

Calls 2

acquireMethod · 0.45
_releaseMethod · 0.45

Tested by

no test coverage detected