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.
This commit is contained in:
Ran Benita 2020-04-24 19:02:31 +03:00
parent 7d5f5a8785
commit e269407e65
1 changed files with 1 additions and 1 deletions

View File

@ -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(