diff --git a/testing/test_collection.py b/testing/test_collection.py index 58f4afb38..06f8d40ee 100644 --- a/testing/test_collection.py +++ b/testing/test_collection.py @@ -966,6 +966,12 @@ def test_collect_init_tests(testdir): "*", ] ) + result = testdir.runpytest("./tests/test_foo.py", "--collect-only") + result.stdout.fnmatch_lines(["*", "*"]) + assert "test_init" not in result.stdout.str() + result = testdir.runpytest("./tests/__init__.py", "--collect-only") + result.stdout.fnmatch_lines(["*", "*"]) + assert "test_foo" not in result.stdout.str() def test_collect_invalid_signature_message(testdir):