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

Method test_invalid_test_module_name

testing/python/collect.py:81–90  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

79 pytest.raises(ImportError, lambda: modcol.obj)
80
81 def test_invalid_test_module_name(self, pytester: Pytester) -> None:
82 a = pytester.mkdir("a")
83 a.joinpath("test_one.part1.py").touch()
84 result = pytester.runpytest()
85 result.stdout.fnmatch_lines(
86 [
87 "ImportError while importing test module*test_one.part1*",
88 "Hint: make sure your test modules/packages have valid Python names.",
89 ]
90 )
91
92 @pytest.mark.parametrize("verbose", [0, 1, 2])
93 def test_show_traceback_import_error(

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
mkdirMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected