PyTest - Markers
You have a test that intermittently fails due to a known issue. You want pytest to mark it as expected failure but fail the test suite if it unexpectedly passes. Which decorator usage is correct?
strict=True causes pytest to fail the suite if an xfail test unexpectedly passes.@pytest.mark.xfail(strict=True) marks the test as expected failure but enforces failure on unexpected pass.strict=False allows unexpected passes without failing suite; skipif skips test; reason only adds explanation.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions