Add failing test for __init__.py also including other package files

This commit is contained in:
Mick Koch 2018-11-01 08:20:01 -04:00
parent 70976b04be
commit 320e41b142
1 changed files with 6 additions and 0 deletions

View File

@ -966,6 +966,12 @@ def test_collect_init_tests(testdir):
"*<Function 'test_foo'>",
]
)
result = testdir.runpytest("./tests/test_foo.py", "--collect-only")
result.stdout.fnmatch_lines(["*<Module 'test_foo.py'>", "*<Function 'test_foo'>"])
assert "test_init" not in result.stdout.str()
result = testdir.runpytest("./tests/__init__.py", "--collect-only")
result.stdout.fnmatch_lines(["*<Module '__init__.py'>", "*<Function 'test_init'>"])
assert "test_foo" not in result.stdout.str()
def test_collect_invalid_signature_message(testdir):