Skip to content

Commit 2f9d5c2

Browse files
authored
Merge pull request #1623 from blueyed/ignore-hidden-files-in-test_pytest_collect_file
Ignore hidden files (.testmondata) in test_pytest_collect_file
2 parents 406355f + e9d7989 commit 2f9d5c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

testing/test_collection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ def test_pytest_collect_file(self, testdir):
150150
wascalled = []
151151
class Plugin:
152152
def pytest_collect_file(self, path, parent):
153-
wascalled.append(path)
153+
if not path.basename.startswith("."):
154+
# Ignore hidden files, e.g. .testmondata.
155+
wascalled.append(path)
154156
testdir.makefile(".abc", "xyz")
155157
pytest.main([testdir.tmpdir], plugins=[Plugin()])
156158
assert len(wascalled) == 1

0 commit comments

Comments
 (0)