(stepwise_pytester: Pytester)
| 112 | |
| 113 | |
| 114 | def test_fail_and_continue_with_stepwise(stepwise_pytester: Pytester) -> None: |
| 115 | # Run the tests with a failing second test. |
| 116 | result = stepwise_pytester.runpytest( |
| 117 | "-v", "--strict-markers", "--stepwise", "--fail" |
| 118 | ) |
| 119 | assert _strip_resource_warnings(result.stderr.lines) == [] |
| 120 | |
| 121 | stdout = result.stdout.str() |
| 122 | # Make sure we stop after first failing test. |
| 123 | assert "test_success_before_fail PASSED" in stdout |
| 124 | assert "test_fail_on_flag FAILED" in stdout |
| 125 | assert "test_success_after_fail" not in stdout |
| 126 | |
| 127 | # "Fix" the test that failed in the last run and run it again. |
| 128 | result = stepwise_pytester.runpytest("-v", "--strict-markers", "--stepwise") |
| 129 | assert _strip_resource_warnings(result.stderr.lines) == [] |
| 130 | |
| 131 | stdout = result.stdout.str() |
| 132 | # Make sure the latest failing test runs and then continues. |
| 133 | assert "test_success_before_fail" not in stdout |
| 134 | assert "test_fail_on_flag PASSED" in stdout |
| 135 | assert "test_success_after_fail PASSED" in stdout |
| 136 | |
| 137 | |
| 138 | @pytest.mark.parametrize("stepwise_skip", ["--stepwise-skip", "--sw-skip"]) |
nothing calls this directly
no test coverage detected