MCPcopy
hub / github.com/pytest-dev/pytest / test_collectonly_error

Method test_collectonly_error

testing/test_terminal.py:578–591  ·  testing/test_terminal.py::TestCollectonly.test_collectonly_error
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

576 )
577
578 def test_collectonly_error(self, pytester: Pytester) -> None:
579 p = pytester.makepyfile(class="st">"import Errlkjqweqwe")
580 result = pytester.runpytest(class="st">"--collect-only", p)
581 assert result.ret == 2
582 result.stdout.fnmatch_lines(
583 textwrap.dedent(
584 class="st">"""\
585 *ERROR*
586 *ImportError*
587 *No module named *Errlk*
588 *1 error*
589 class="st">"""
590 ).strip()
591 )
592
593 def test_collectonly_missing_path(self, pytester: Pytester) -> None:
594 class="st">"""Issue 115: failure in parseargs will cause session not to

Callers

nothing calls this directly

Calls 4

fnmatch_linesMethod · 0.80
stripMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected