You can use the xfail marker to indicate that you expect a test to fail:@pytest.mark.xfail def test_function(): ...
This test will be run but no traceback will be reported when it fails. Instead terminal reporting will list it in the “expected to fail” (XFAIL) or “unexpectedly passing” (XPASS) sections.