Learning center

Hand over skipped tests so that someone can un-skip them

Give every skipped or expected-to-fail test a reason, an owner and the condition that ends it. Reports count these tests in ways that hide the difference between "cannot run here" and "known to be broken".

How one report counts five kinds#

The fixture has six tests, run with pytest 9.2. The terminal summary is 1 passed, 3 skipped, 1 xfailed, 1 xpassed, with exit 0. The JUnit file of the same run says tests="6" skipped="4" failures="0":

TestTerminalJUnit
skip(reason="flaky, see EX-12")skipped<skipped> with the reason
skip with no reasonskipped<skipped>, "unconditional skip"
skipif(..., reason="needs postgres")skipped<skipped> with the reason
xfail, and it failsxfailed<skipped type="pytest.xfail">
xfail, and it passesxpassedA plain pass

Two lines deserve attention. An expected failure is a test that ran and found the bug, and JUnit files it with tests that never ran. A test that passes although it was expected to fail is news, perhaps that the bug is fixed, and JUnit shows nothing at all.

Playwright 1.65 is similar from another side. test.skip and test.fixme both became <skipped> in JUnit, and a <property> with the name skip or fixme and an empty value was the only difference. With no reason written, there was nothing else to read.

Make the list#

pytest -q -rsxX            # reasons for skipped, xfailed and xpassed
npx playwright test --list
git grep -nE '\b(test|it|describe)\.(skip|fixme)|pytest\.mark\.(skip|xfail)|t\.Skip\(' HEAD

The search finds what is written in the source. The run finds what was skipped here, including skips that depend on a missing service. Compare the two. A test that the run skips and the search cannot explain is usually conditional, and the condition may be true only on your machine.

Four fields per test#

FieldExample
KindCannot run here, quarantined, or known bug
EvidenceEX-12, 9 failures of 60 runs on 2026-11-20
OwnerCheckout team
Ends whenEX-12 is closed, or 2026-12-04, whichever is first

A date matters because a quarantine with a condition only can outlive everyone who knows the condition. When it passes, somebody decides again: fix, delete or extend with a new reason.

For a known bug, prefer an expected failure over a skip, and make it strict. With xfail_strict=true, the unexpected pass in the fixture became FAILED ... [XPASS(strict)], so the fix announces itself.

What to tell the release owner#

Say which behaviors have no running test as a result, in product terms: "No test covers refunds above the original amount while EX-12 is open." A count of 14 skipped tests out of 1,204 sounds small and says nothing about whether they share one feature.

Worked example#

This example is fictional. QA hands over "1,190 passed, 14 skipped, 0 failed". Eleven of the skips need a database that this job lacks, and another job runs them. Two are quarantined, with an end date in September. One has no reason, and its history shows that it was skipped in the commit that introduced the feature being released. The release owner asks for that one to run. It fails.

To tell a filter from a skip, check the executed count. Return to handing over evidence.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading