Handle cache warnings in tests

This commit is contained in:
Bruno Oliveira 2018-09-04 14:44:02 -03:00
parent d3f72ca202
commit f1cfd10c94
1 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,7 @@ class TestNewAPI(object):
cache.set("test/broken", []) cache.set("test/broken", [])
@pytest.mark.skipif(sys.platform.startswith("win"), reason="no chmod on windows") @pytest.mark.skipif(sys.platform.startswith("win"), reason="no chmod on windows")
@pytest.mark.filterwarnings("ignore:could not create cache path:PytestWarning")
def test_cache_writefail_permissions(self, testdir): def test_cache_writefail_permissions(self, testdir):
testdir.makeini("[pytest]") testdir.makeini("[pytest]")
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0) testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
@ -48,6 +49,7 @@ class TestNewAPI(object):
cache.set("test/broken", []) cache.set("test/broken", [])
@pytest.mark.skipif(sys.platform.startswith("win"), reason="no chmod on windows") @pytest.mark.skipif(sys.platform.startswith("win"), reason="no chmod on windows")
@pytest.mark.filterwarnings("default")
def test_cache_failure_warns(self, testdir): def test_cache_failure_warns(self, testdir):
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0) testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
testdir.makepyfile( testdir.makepyfile(