diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 4a7e4d9b3..eb4555490 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -70,12 +70,6 @@ class StepwisePlugin: config.hook.pytest_deselected(items=already_passed) - def pytest_collectreport(self, report): - if self.active and report.failed: - self.session.shouldstop = ( - "Error when collecting test, stopping test execution." - ) - def pytest_runtest_logreport(self, report): # Skip this hook if plugin is not active or the test is xfailed. if not self.active or "xfail" in report.keywords: diff --git a/testing/test_stepwise.py b/testing/test_stepwise.py index 4b018c722..a463b6828 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -164,10 +164,4 @@ def test_stop_on_collection_errors(broken_testdir, broken_first): if broken_first: files.reverse() result = broken_testdir.runpytest("-v", "--strict-markers", "--stepwise", *files) - - if broken_first: - result.stdout.fnmatch_lines( - "*Error when collecting test, stopping test execution*" - ) - else: - result.stdout.fnmatch_lines("*errors during collection*") + result.stdout.fnmatch_lines("*errors during collection*")