Closed
Description
I want to disable PytestCacheWarning
with the following pytest.ini
file:
[pytest]
filterwarnings =
ignore::pytest.PytestCacheWarning
But the warnings are still shown in report summary.
Minimal reproducible example:
pytest.ini
file as shown above- empty directory
.pytest_cache
with 444 permissions - running pytest gives the following:
~/repos/reproduce_pytest_bug$ pytest
============= test session starts =================
platform linux -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /home/sanyash/repos/reproduce_pytest_bug, inifile: pytest.ini
plugins: celery-4.4.0, aiohttp-0.3.0
collected 0 items
============= warnings summary ================
/home/sanyash/.local/lib/python3.7/site-packages/_pytest/cacheprovider.py:137
/home/sanyash/.local/lib/python3.7/site-packages/_pytest/cacheprovider.py:137: PytestCacheWarning: could not create cache path /home/sanyash/repos/reproduce_pytest_bug/.pytest_cache/v/cache/stepwise
self.warn("could not create cache path {path}", path=path)
/home/sanyash/.local/lib/python3.7/site-packages/_pytest/cacheprovider.py:137
/home/sanyash/.local/lib/python3.7/site-packages/_pytest/cacheprovider.py:137: PytestCacheWarning: could not create cache path /home/sanyash/repos/reproduce_pytest_bug/.pytest_cache/v/cache/nodeids
self.warn("could not create cache path {path}", path=path)
-- Docs: https://docs.pytest.org/en/latest/warnings.html
============= 2 warnings in 0.00s =============
versions:
- Ubuntu 18.04
- Python 3.7.6
- pytest 5.3.5