(self, tmp_path: Path)
| 15 | |
| 16 | class TestStatRecorder: |
| 17 | def test_filechange(self, tmp_path: Path) -> None: |
| 18 | tmp = tmp_path |
| 19 | hello = tmp / "hello.py" |
| 20 | hello.touch() |
| 21 | sd = StatRecorder([tmp]) |
| 22 | changed = sd.check() |
| 23 | assert not changed |
| 24 | |
| 25 | hello.write_text("world") |
| 26 | changed = sd.check() |
| 27 | assert changed |
| 28 | |
| 29 | hello.with_suffix(".pyc").write_text("hello") |
| 30 | changed = sd.check() |
| 31 | assert not changed |
| 32 | |
| 33 | p = tmp / "new.py" |
| 34 | p.touch() |
| 35 | changed = sd.check() |
| 36 | assert changed |
| 37 | |
| 38 | p.unlink() |
| 39 | changed = sd.check() |
| 40 | assert changed |
| 41 | |
| 42 | tmp.joinpath("a", "b").mkdir(parents=True) |
| 43 | tmp.joinpath("a", "b", "c.py").touch() |
| 44 | changed = sd.check() |
| 45 | assert changed |
| 46 | |
| 47 | tmp.joinpath("a", "c.txt").touch() |
| 48 | changed = sd.check() |
| 49 | assert changed |
| 50 | changed = sd.check() |
| 51 | assert not changed |
| 52 | |
| 53 | shutil.rmtree(str(tmp.joinpath("a"))) |
| 54 | changed = sd.check() |
| 55 | assert changed |
| 56 | |
| 57 | def test_dirchange(self, tmp_path: Path) -> None: |
| 58 | tmp = tmp_path |
nothing calls this directly
no test coverage detected