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

Method test_pass_skip_fail

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

Source from the content-addressed store, hash-verified

87
88class TestTerminal:
89 def test_pass_skip_fail(self, pytester: Pytester, option) -> None:
90 pytester.makepyfile(
91 """
92 import pytest
93 def test_ok():
94 pass
95 def test_skip():
96 pytest.skip("xx")
97 def test_func():
98 assert 0
99 """
100 )
101 result = pytester.runpytest(*option.args)
102 if option.verbosity > 0:
103 result.stdout.fnmatch_lines(
104 [
105 "*test_pass_skip_fail.py::test_ok PASS*",
106 "*test_pass_skip_fail.py::test_skip SKIP*",
107 "*test_pass_skip_fail.py::test_func FAIL*",
108 ]
109 )
110 elif option.verbosity == 0:
111 result.stdout.fnmatch_lines(["*test_pass_skip_fail.py .sF*"])
112 else:
113 result.stdout.fnmatch_lines([".sF*"])
114 result.stdout.fnmatch_lines(
115 [" def test_func():", "> assert 0", "E assert 0"]
116 )
117
118 def test_console_output_style_times_with_skipped_and_passed(
119 self, pytester: Pytester

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected