Coverage as a signal, not a goal
P30.pytest-foundations.03 · Audience: guest, it-ml, language-pro · Prerequisites: Fixtures & parametrisation
You can reach 100% coverage without testing anything. Coverage measures which lines ran, never whether you checked what they did - so a suite of assertion-free tests can be green at 100% while the code is silently broken. This short module makes coverage an honest tool: a lower bound that finds untested code, not a target you game.
ⓘ Concept: Lines that ran, not results that were checked
Why it matters — Teams adopt a coverage gate expecting confidence and get a number that a lazy test can satisfy - knowing the difference stops the metric from lying to you.
Ask the mentor about this module
Ask a question about this content. The mentor explains and grounds its answer in what you are studying; asking is recorded as a learning signal, not a grade.
🎓 Practice ladder
2 graded rungs · ~18 minYour turn: critique a 100%-coverage suite that would pass even if the code were wrong, then step back for the interview question on what makes a whole suite trustworthy.
Rung 1 - critique a 100%-coverage suite that tests nothing (free-form)
Loading exercise…
Interview rung - what makes a test suite trustworthy? (free-form)
Loading exercise…
Coverage is a flashlight, not a finish line: it shows you the corners no test has walked into, and says nothing about whether the room is tidy.
Where next?
Later in pytest Foundations
Go up a level