git: df997faca841 - main - atf_pytest: fix xfail detection from pytest report
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 Sep 2025 13:01:27 UTC
The branch main has been updated by emaste:
URL: https://cgit.FreeBSD.org/src/commit/?id=df997faca8411bdf8008c25de5db3ed719019d21
commit df997faca8411bdf8008c25de5db3ed719019d21
Author: Siva Mahadevan <me@svmhdvn.name>
AuthorDate: 2025-09-17 20:34:58 +0000
Commit: Ed Maste <emaste@FreeBSD.org>
CommitDate: 2025-09-18 13:01:14 +0000
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 <me@svmhdvn.name>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1849
Sponsored by: The FreeBSD Foundation
---
tests/atf_python/atf_pytest.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/atf_python/atf_pytest.py b/tests/atf_python/atf_pytest.py
index 19b5f88fa200..02ed502ace67 100644
--- a/tests/atf_python/atf_pytest.py
+++ b/tests/atf_python/atf_pytest.py
@@ -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"