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

Class MovingPath

tests/sqlite/test_lock_settings.py:64–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 spool.mkdir()
63
64 class MovingPath:
65 calls = 0
66
67 def __fspath__(self) -> str:
68 self.calls += 1
69 if self.calls == 2:
70 monkeypatch.chdir(spool)
71 return "gate.db"
72
73 monkeypatch.chdir(state)
74 with pytest.raises(RuntimeError, match="path changed during singleton construction"):

Calls

no outgoing calls