The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=df997faca8411bdf8008c25de5db3ed719019d21
commit df997faca8411bdf8008c25de5db3ed719019d21 Author: Siva Mahadevan <[email protected]> AuthorDate: 2025-09-17 20:34:58 +0000 Commit: Ed Maste <[email protected]> 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 <[email protected]> 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"
