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.
This commit is contained in:
Bruno Oliveira 2019-06-13 17:19:36 -03:00
parent 4cc05a657d
commit bc345ac980
2 changed files with 1 additions and 13 deletions

View File

@ -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:

View File

@ -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*")