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

Method test_pass_skip_fail

testing/test_terminal.py:82–109  ·  view source on GitHub ↗
(self, pytester: Pytester, option)

Source from the content-addressed store, hash-verified

80
81class TestTerminal:
82 def test_pass_skip_fail(self, pytester: Pytester, option) -> None:
83 pytester.makepyfile(
84 """
85 import pytest
86 def test_ok():
87 pass
88 def test_skip():
89 pytest.skip("xx")
90 def test_func():
91 assert 0
92 """
93 )
94 result = pytester.runpytest(*option.args)
95 if option.verbosity > 0:
96 result.stdout.fnmatch_lines(
97 [
98 "*test_pass_skip_fail.py::test_ok PASS*",
99 "*test_pass_skip_fail.py::test_skip SKIP*",
100 "*test_pass_skip_fail.py::test_func FAIL*",
101 ]
102 )
103 elif option.verbosity == 0:
104 result.stdout.fnmatch_lines(["*test_pass_skip_fail.py .sF*"])
105 else:
106 result.stdout.fnmatch_lines([".sF*"])
107 result.stdout.fnmatch_lines(
108 [" def test_func():", "> assert 0", "E assert 0"]
109 )
110
111 def test_internalerror(self, pytester: Pytester, linecomp) -> None:
112 modcol = pytester.getmodulecol("def test_one(): pass")

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected