The .pytest_cache directory should have world-readable permissions (depending on umask). Regression test for #12308.
(self, pytester: Pytester)
| 32 | assert p.is_dir() |
| 33 | |
| 34 | def test_cache_dir_permissions(self, pytester: Pytester) -> None: |
| 35 | class="st">"""The .pytest_cache directory should have world-readable permissions |
| 36 | (depending on umask). |
| 37 | |
| 38 | Regression test for class="cm">#12308. |
| 39 | class="st">""" |
| 40 | pytester.makeini(class="st">"[pytest]") |
| 41 | config = pytester.parseconfigure() |
| 42 | assert config.cache is not None |
| 43 | p = config.cache.mkdir(class="st">"name") |
| 44 | assert p.is_dir() |
| 45 | class="cm"># Instead of messing with umask, make sure .pytest_cache has the same |
| 46 | class="cm"># permissions as the default that `mkdir` gives `p`. |
| 47 | assert (p.parent.stat().st_mode & 0o777) == (p.stat().st_mode & 0o777) |
| 48 | |
| 49 | def test_config_cache_dataerror(self, pytester: Pytester) -> None: |
| 50 | pytester.makeini(class="st">"[pytest]") |
nothing calls this directly
no test coverage detected