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

Function test_run_with_skip_option

testing/test_stepwise.py:139–155  ·  view source on GitHub ↗
(stepwise_pytester: Pytester, stepwise_skip: str)

Source from the content-addressed store, hash-verified

137
138@pytest.mark.parametrize("stepwise_skip", ["--stepwise-skip", "--sw-skip"])
139def test_run_with_skip_option(stepwise_pytester: Pytester, stepwise_skip: str) -> None:
140 result = stepwise_pytester.runpytest(
141 "-v",
142 "--strict-markers",
143 "--stepwise",
144 stepwise_skip,
145 "--fail",
146 "--fail-last",
147 )
148 assert _strip_resource_warnings(result.stderr.lines) == []
149
150 stdout = result.stdout.str()
151 # Make sure first fail is ignore and second fail stops the test run.
152 assert "test_fail_on_flag FAILED" in stdout
153 assert "test_success_after_fail PASSED" in stdout
154 assert "test_fail_last_on_flag FAILED" in stdout
155 assert "test_success_after_last_fail" not in stdout
156
157
158def test_fail_on_errors(error_pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

strMethod · 0.80
_strip_resource_warningsFunction · 0.70
runpytestMethod · 0.45

Tested by

no test coverage detected