From e269407e650b58b50abb5f97f3191869fa24e303 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 24 Apr 2020 19:02:31 +0300 Subject: [PATCH] testing: avoid pytest_collect_directory message in warnings summary Currently this test issues a warning which is displayed in the warning summary (of pytest's own test suite): testing/acceptance_test.py::TestGeneralUsage::test_early_skip /tmp/pytest-of-ran/pytest-396/test_early_skip0/conftest.py:2: PytestDeprecationWarning: The pytest_collect_directory hook is not working. Please use collect_ignore in conftests or pytest_collection_modifyitems. def pytest_collect_directory(): I think the filter was meant to be `ignore` in the first place, and not `always` which is not a valid action AFAIK. --- testing/acceptance_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 0ac3be122..fd330f670 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -223,7 +223,7 @@ class TestGeneralUsage: "E {}: No module named 'qwerty'".format(exc_name), ] - @pytest.mark.filterwarnings("always::pytest.PytestDeprecationWarning") + @pytest.mark.filterwarnings("ignore::pytest.PytestDeprecationWarning") def test_early_skip(self, testdir): testdir.mkdir("xyz") testdir.makeconftest(