Propagate internal errors to the master node

This should help users diagnose internal errors in workers like
exceptions from hooks or in pytest itself.
This commit is contained in:
Bruno Oliveira
2020-12-12 11:34:57 -03:00
parent 948f13730d
commit 16d636391b
5 changed files with 36 additions and 1 deletions

View File

@@ -1138,6 +1138,18 @@ def test_internal_error_with_maxfail(testdir):
assert "INTERNALERROR" not in result.stderr.str()
def test_internal_errors_propagate_to_master(testdir):
testdir.makeconftest(
"""
def pytest_collection_modifyitems():
raise RuntimeError("Some runtime error")
"""
)
testdir.makepyfile("def test(): pass")
result = testdir.runpytest("-n1")
result.stdout.fnmatch_lines(["*RuntimeError: Some runtime error*"])
class TestLoadScope:
def test_by_module(self, testdir):
test_file = """