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

Function test_change_testfile

testing/test_stepwise.py:168–185  ·  view source on GitHub ↗
(stepwise_pytester: Pytester)

Source from the content-addressed store, hash-verified

166
167
168def test_change_testfile(stepwise_pytester: Pytester) -> None:
169 result = stepwise_pytester.runpytest(
170 "-v", "--strict-markers", "--stepwise", "--fail", "test_a.py"
171 )
172 assert _strip_resource_warnings(result.stderr.lines) == []
173
174 stdout = result.stdout.str()
175 assert "test_fail_on_flag FAILED" in stdout
176
177 # Make sure the second test run starts from the beginning, since the
178 # test to continue from does not exist in testfile_b.
179 result = stepwise_pytester.runpytest(
180 "-v", "--strict-markers", "--stepwise", "test_b.py"
181 )
182 assert _strip_resource_warnings(result.stderr.lines) == []
183
184 stdout = result.stdout.str()
185 assert "test_success PASSED" in stdout
186
187
188@pytest.mark.parametrize("broken_first", [True, False])

Callers

nothing calls this directly

Calls 3

strMethod · 0.80
_strip_resource_warningsFunction · 0.70
runpytestMethod · 0.45

Tested by

no test coverage detected