expected failure
A test marked with @pytest.mark.xfail because it is known to fail today, reported as xfailed instead of failed.
In more detail
It records a known bug in the suite rather than deleting the test. If the test starts passing, pytest reports it as xpassed, and with strict=True that counts as a failure so you notice the fix.
Related terms
- parametrized test — One test function run many times with different data, each run reported as a separate test case.
- skipped test — A test pytest deliberately did not run, because it was marked to skip or a condition such as a missing dependency applied.
- marker — A label attached to a test with @pytest.mark.name so you can select, skip or configure tests by that label.
Taught in
- Parametrised Tests — Automated Testing, TDD & Quality Engineering