Coverage as a signal, not a goal
P30.pytest-foundations.03 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Fixtures & parametrisation
Where next?
Later in pytest Foundations
Go up a level
P30.pytest-foundations.03 · Audience: Guest, IT/ML learner, Language professional · Prerequisites: Fixtures & parametrisation
Later in pytest Foundations
Go up a level
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.
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 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.
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.
Your 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.
Loading exercise…
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.
Loading your notes...