We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When runxfail option is set (pytest --runxfail ...) tests that use check are reported as xfail instead of failed:
runxfail
pytest --runxfail ...
check
xfail_test.py
import pytest @pytest.mark.xfail(reason="foo") def test_xfail(check): with check: # with this line gone, this is actual behaviour assert False
$ pytest --runxfail xfail_test.py ================================================================ test session starts ================================================================= platform linux -- Python 3.10.12, pytest-8.3.4, pluggy-1.5.0 rootdir: /home/taylermulligan/pytest_xfail plugins: check-2.4.1 collected 1 item xfail_test.py F [100%] ====================================================================== FAILURES ====================================================================== _____________________________________________________________________ test_xfail _____________________________________________________________________ check = <pytest_check.context_manager.CheckContextManager object at 0x7f2db410d120> @pytest.mark.xfail(reason="foo") def test_xfail(check): > assert False E assert False xfail_test.py:5: AssertionError ============================================================== short test summary info =============================================================== FAILED xfail_test.py::test_xfail - assert False ================================================================= 1 failed in 0.01s ==================================================================
$ pytest --runxfail xfail_test.py ================================================================ test session starts ================================================================= platform linux -- Python 3.10.12, pytest-8.3.4, pluggy-1.5.0 rootdir: /home/taylermulligan/pytest_xfail plugins: check-2.4.1 collected 1 item xfail_test.py x [100%] ================================================================= 1 xfailed in 0.03s =================================================================
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
When
runxfail
option is set (pytest --runxfail ...
) tests that usecheck
are reported as xfail instead of failed:xfail_test.py
Expected behaviour
Actual behaviour
The text was updated successfully, but these errors were encountered: