Merge pull request #1623 from blueyed/ignore-hidden-files-in-test_pytest_collect_file
Ignore hidden files (.testmondata) in test_pytest_collect_file
This commit is contained in:
commit
2f9d5c2586
|
@ -150,7 +150,9 @@ class TestCollectPluginHookRelay:
|
||||||
wascalled = []
|
wascalled = []
|
||||||
class Plugin:
|
class Plugin:
|
||||||
def pytest_collect_file(self, path, parent):
|
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")
|
testdir.makefile(".abc", "xyz")
|
||||||
pytest.main([testdir.tmpdir], plugins=[Plugin()])
|
pytest.main([testdir.tmpdir], plugins=[Plugin()])
|
||||||
assert len(wascalled) == 1
|
assert len(wascalled) == 1
|
||||||
|
|
Loading…
Reference in New Issue