diff --git a/testing/test_collection.py b/testing/test_collection.py index 749c5b7ce..cd0a5cc19 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -150,7 +150,9 @@ class TestCollectPluginHookRelay: wascalled = [] class Plugin: def pytest_collect_file(self, path, parent): - wascalled.append(path) + if not path.basename.startswith("."): + # Ignore hidden files, e.g. .testmondata. + wascalled.append(path) testdir.makefile(".abc", "xyz") pytest.main([testdir.tmpdir], plugins=[Plugin()]) assert len(wascalled) == 1