(self)
| 50 | self.helper = _load_helper() |
| 51 | |
| 52 | def tearDown(self) -> None: |
| 53 | # On Windows, .git often has read-only objects. Clear them first. |
| 54 | for root, dirs, files in os.walk(self.tmp): |
| 55 | for name in dirs + files: |
| 56 | p = Path(root) / name |
| 57 | try: |
| 58 | p.chmod(0o700) |
| 59 | except KeyboardInterrupt: |
| 60 | import _thread |
| 61 | |
| 62 | _thread.interrupt_main() |
| 63 | raise |
| 64 | except OSError: |
| 65 | pass |
| 66 | self._tmp.cleanup() |
| 67 | |
| 68 | def test_orphan_directory_is_safe(self) -> None: |
| 69 | orphan = self.tmp / "orphan" |