Ignore hidden files (.testmondata) in test_pytest_collect_file

`test_pytest_collect_file` fails if you run the tests using `--testmon`,
because pytest-testmon will put its DB there as `.testmondata`.
This commit is contained in:
Daniel Hahler 2016-06-20 22:30:36 +02:00
parent d81ee9acfb
commit e9d7989140
1 changed files with 3 additions and 1 deletions

View File

@ -150,6 +150,8 @@ class TestCollectPluginHookRelay:
wascalled = []
class Plugin:
def pytest_collect_file(self, path, parent):
if not path.basename.startswith("."):
# Ignore hidden files, e.g. .testmondata.
wascalled.append(path)
testdir.makefile(".abc", "xyz")
pytest.main([testdir.tmpdir], plugins=[Plugin()])