(
self,
pytester: Pytester,
monkeypatch: MonkeyPatch,
unwritable_cache_dir: Path,
)
| 70 | |
| 71 | @pytest.mark.filterwarnings("default") |
| 72 | def test_cache_failure_warns( |
| 73 | self, |
| 74 | pytester: Pytester, |
| 75 | monkeypatch: MonkeyPatch, |
| 76 | unwritable_cache_dir: Path, |
| 77 | ) -> None: |
| 78 | monkeypatch.setenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD", "1") |
| 79 | |
| 80 | pytester.makepyfile("def test_error(): raise Exception") |
| 81 | result = pytester.runpytest() |
| 82 | assert result.ret == 1 |
| 83 | # warnings from nodeids, lastfailed, and stepwise |
| 84 | result.stdout.fnmatch_lines( |
| 85 | [ |
| 86 | # Validate location/stacklevel of warning from cacheprovider. |
| 87 | "*= warnings summary =*", |
| 88 | "*/cacheprovider.py:*", |
| 89 | " */cacheprovider.py:*: PytestCacheWarning: could not create cache path " |
| 90 | f"{unwritable_cache_dir}/v/cache/nodeids", |
| 91 | ' config.cache.set("cache/nodeids", sorted(self.cached_nodeids))', |
| 92 | "*1 failed, 3 warnings in*", |
| 93 | ] |
| 94 | ) |
| 95 | |
| 96 | def test_config_cache(self, pytester: Pytester) -> None: |
| 97 | pytester.makeconftest( |
nothing calls this directly
no test coverage detected