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

Function test_module_not_found

testing/test_pythonpath.py:64–71  ·  view source on GitHub ↗

Without the pythonpath setting, the module should not be found.

(pytester: Pytester, file_structure)

Source from the content-addressed store, hash-verified

62
63
64def test_module_not_found(pytester: Pytester, file_structure) -> None:
65 """Without the pythonpath setting, the module should not be found."""
66 pytester.makefile(".ini", pytest="[pytest]\n")
67 result = pytester.runpytest("test_foo.py")
68 assert result.ret == pytest.ExitCode.INTERRUPTED
69 result.assert_outcomes(errors=1)
70 expected_error = "E ModuleNotFoundError: No module named 'foo'"
71 result.stdout.fnmatch_lines([expected_error])
72
73
74def test_no_ini(pytester: Pytester, file_structure) -> None:

Callers

nothing calls this directly

Calls 4

assert_outcomesMethod · 0.80
fnmatch_linesMethod · 0.80
makefileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected