diff --git a/_pytest/config.py b/_pytest/config.py index b75f7908254..a6fe4432273 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -926,11 +926,12 @@ def pytest_cmdline_parse(self, pluginmanager, args): return self def notify_exception(self, excinfo, option=None): - if option and option.fulltrace: + if getattr(option, 'fulltrace', False): style = "long" else: style = "native" - excrepr = excinfo.getrepr(funcargs=True, + excrepr = excinfo.getrepr( + funcargs=True, showlocals=getattr(option, 'showlocals', False), style=style, ) @@ -938,7 +939,7 @@ def notify_exception(self, excinfo, option=None): excinfo=excinfo) if not py.builtin.any(res): for line in str(excrepr).split("\n"): - sys.stderr.write("INTERNALERROR> %s\n" %line) + sys.stderr.write("INTERNALERROR> %s\n" % line) sys.stderr.flush() def cwd_relative_nodeid(self, nodeid): diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index debda79ca34..5a3827908c7 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -28,7 +28,9 @@ def test_root_conftest_syntax_error(self, testdir): result.stderr.fnmatch_lines(["*raise SyntaxError*"]) assert result.ret != 0 - def test_early_hook_error_issue38_1(self, testdir): + def test_early_hook_error_issue38_1(self, pytestconfig, testdir): + if getattr(pytestconfig, 'slaveinput', False): + pytest.xfail("xdist breaks exception notification, issue #2321") testdir.makeconftest(""" def pytest_sessionstart(): 0 / 0