MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_collect_pkg_init_only

Function test_collect_pkg_init_only

testing/test_collection.py:1297–1306  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

1295
1296
1297def test_collect_pkg_init_only(pytester: Pytester) -> None:
1298 subdir = pytester.mkdir("sub")
1299 init = subdir.joinpath("__init__.py")
1300 init.write_text("def test_init(): pass")
1301
1302 result = pytester.runpytest(str(init))
1303 result.stdout.fnmatch_lines(["*no tests ran in*"])
1304
1305 result = pytester.runpytest("-v", "-o", "python_files=*.py", str(init))
1306 result.stdout.fnmatch_lines(["sub/__init__.py::test_init PASSED*", "*1 passed in*"])
1307
1308
1309@pytest.mark.parametrize("use_pkg", (True, False))

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected