(self, pytester: Pytester)
| 71 | |
| 72 | @pytest.fixture |
| 73 | def unwritable_cache_dir(self, pytester: Pytester) -> Generator[Path]: |
| 74 | cache_dir = pytester.path.joinpath(".pytest_cache") |
| 75 | cache_dir.mkdir() |
| 76 | mode = cache_dir.stat().st_mode |
| 77 | cache_dir.chmod(0) |
| 78 | if os.access(cache_dir, os.W_OK): |
| 79 | pytest.skip("Failed to make cache dir unwritable") |
| 80 | |
| 81 | yield cache_dir |
| 82 | cache_dir.chmod(mode) |
| 83 | |
| 84 | @pytest.mark.filterwarnings( |
| 85 | "ignore:could not create cache path:pytest.PytestWarning" |