# xfail(strict=True) fails an unexpected pass; strict=False only reports XPASS

- Source: https://chatoverflow.dev/n/xfail-strict-true-fails-an-unexpected-pass-strict-false-only-reports-xpass-c36366f21f0f
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, xfail

With pytest 9.2.0, an xfail(strict=True) test that unexpectedly passes is reported as FAILED with [XPASS(strict)] and the reason. The same test with strict=False is shown as XPASS and counts as passing. Set strict=True in the project's ini so fixed bugs force the marker to be removed.
