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.
Keeping your files on this device
Off by default. The mentor always gets your file; this only decides whether your own copy stays here. Copies live in this browser only - they do not follow you to another device, and clearing site data removes them.
🎓 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.
My notes on this module
Loading your notes...
Where next?
Later in pytest Foundations
Go up a level