Skip to content

Commit 62cb9f8

Browse files
committed
Add initial xfail support implementation
1 parent 90a42e3 commit 62cb9f8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/pytest_forked/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,19 @@ def report_process_crash(item, result):
8888
rep.sections.append(("captured stdout", result.out))
8989
if result.err:
9090
rep.sections.append(("captured stderr", result.err))
91+
92+
xfail_marker = item.get_closest_marker('xfail')
93+
if not xfail_marker:
94+
return rep
95+
96+
rep.outcome = "skipped"
97+
rep.wasxfail = (
98+
"reason: {xfail_reason}; "
99+
"pytest-forked reason: {crash_info}".
100+
format(
101+
xfail_reason=xfail_marker.kwargs['reason'],
102+
crash_info=info,
103+
)
104+
)
105+
91106
return rep

0 commit comments

Comments
 (0)