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

Function test_no_ini

testing/test_pythonpath.py:74–80  ·  view source on GitHub ↗

If no ini file, test should error.

(pytester: Pytester, file_structure)

Source from the content-addressed store, hash-verified

72
73
74def test_no_ini(pytester: Pytester, file_structure) -> None:
75 """If no ini file, test should error."""
76 result = pytester.runpytest("test_foo.py")
77 assert result.ret == pytest.ExitCode.INTERRUPTED
78 result.assert_outcomes(errors=1)
79 expected_error = "E ModuleNotFoundError: No module named 'foo'"
80 result.stdout.fnmatch_lines([expected_error])
81
82
83def test_clean_up(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

assert_outcomesMethod · 0.80
fnmatch_linesMethod · 0.80
runpytestMethod · 0.45

Tested by

no test coverage detected