(self, pytester: Pytester)
| 46 | |
| 47 | @pytest.fixture |
| 48 | def unwritable_cache_dir(self, pytester: Pytester) -> Generator[Path, None, None]: |
| 49 | cache_dir = pytester.path.joinpath(".pytest_cache") |
| 50 | cache_dir.mkdir() |
| 51 | mode = cache_dir.stat().st_mode |
| 52 | cache_dir.chmod(0) |
| 53 | if os.access(cache_dir, os.W_OK): |
| 54 | pytest.skip("Failed to make cache dir unwritable") |
| 55 | |
| 56 | yield cache_dir |
| 57 | cache_dir.chmod(mode) |
| 58 | |
| 59 | @pytest.mark.filterwarnings( |
| 60 | "ignore:could not create cache path:pytest.PytestWarning" |