From 43a499e6fa02436104f239f736b8ac837c200128 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 13 Jun 2019 17:19:36 -0300 Subject: [PATCH] Remove handling of collection errors by --sw Since then pytest itself adopted the behavior of interrupting the test session on collection errors, so --sw no longer needs to handle this. The --sw behavior seems have been implemented when pytest would continue execution even if there were collection errors. --- src/_pytest/stepwise.py | 6 ------ testing/test_stepwise.py | 8 +------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/_pytest/stepwise.py b/src/_pytest/stepwise.py index 274f50ff0..81b9fa0f4 100644 --- a/src/_pytest/stepwise.py +++ b/src/_pytest/stepwise.py @@ -71,12 +71,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 c099fec0f..3b799a830 100644 --- a/testing/test_stepwise.py +++ b/testing/test_stepwise.py @@ -165,10 +165,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*")