mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
atf_pytest: fix xfail detection from pytest report
The location of the 'wasxfail' attribute was moved from the 'reason' attribute back to the parent 'report'. This fixes an issue where xfails are wrongly reported to ATF as skipped tests. Signed-off-by: Siva Mahadevan <[email protected]> Pull-request: https://github.com/freebsd/freebsd-src/pull/1849 Sponsored by: The FreeBSD Foundation
This commit is contained in:
1 parent
506b36c4fd
commit
df997faca8
1 file changed
+2
-2
@@ -256,7 +256,7 @@ class ATFHandler(object):
|
||||
# Record failure & override "skipped" state
|
||||
self.set_report_state(test_name, state, reason)
|
||||
elif state == "skipped":
|
||||
if hasattr(reason, "wasxfail"):
|
||||
if hasattr(report, "wasxfail"):
|
||||
# xfail() called in the test body
|
||||
state = "expected_failure"
|
||||
else:
|
||||
@@ -264,7 +264,7 @@ class ATFHandler(object):
|
||||
pass
|
||||
self.set_report_state(test_name, state, reason)
|
||||
elif state == "passed":
|
||||
if hasattr(reason, "wasxfail"):
|
||||
if hasattr(report, "wasxfail"):
|
||||
# the test was expected to fail but didn't
|
||||
# mark as hard failure
|
||||
state = "failed"
|
||||
|
||||
Reference in new issue
Block a user