Skip to content

Commit 434ca5c

Browse files
add xfail for #2321
1 parent 1affc39 commit 434ca5c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

_pytest/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -926,19 +926,20 @@ def pytest_cmdline_parse(self, pluginmanager, args):
926926
return self
927927

928928
def notify_exception(self, excinfo, option=None):
929-
if option and option.fulltrace:
929+
if getattr(option, 'fulltrace', False):
930930
style = "long"
931931
else:
932932
style = "native"
933-
excrepr = excinfo.getrepr(funcargs=True,
933+
excrepr = excinfo.getrepr(
934+
funcargs=True,
934935
showlocals=getattr(option, 'showlocals', False),
935936
style=style,
936937
)
937938
res = self.hook.pytest_internalerror(excrepr=excrepr,
938939
excinfo=excinfo)
939940
if not py.builtin.any(res):
940941
for line in str(excrepr).split("\n"):
941-
sys.stderr.write("INTERNALERROR> %s\n" %line)
942+
sys.stderr.write("INTERNALERROR> %s\n" % line)
942943
sys.stderr.flush()
943944

944945
def cwd_relative_nodeid(self, nodeid):

testing/acceptance_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def test_root_conftest_syntax_error(self, testdir):
2828
result.stderr.fnmatch_lines(["*raise SyntaxError*"])
2929
assert result.ret != 0
3030

31-
def test_early_hook_error_issue38_1(self, testdir):
31+
def test_early_hook_error_issue38_1(self, pytestconfig, testdir):
32+
if getattr(pytestconfig, 'slaveinput', False):
33+
pytest.xfail("xdist breaks exception notification, issue #2321")
3234
testdir.makeconftest("""
3335
def pytest_sessionstart():
3436
0 / 0

0 commit comments

Comments
 (0)