runtime
242 / 500
question 242 Testing & Code Quality · easy

Tests that can't fail

price_with_vat adds 20% VAT and rounds to the penny, and its TestCase has always passed. Then someone broke the function and the tests *still* passed. Every test method here has a bug that stops it from failing. Fix the tests (not the function) so that they check what their names promise.

Fixthe four test methods of TestPriceWithVat
Ruleprice_with_vat(10) → 12.0; (19.99) → 23.99; (0.01) → 0.01; (2.49) → 2.99; (5) → 6.0; (0) → 0

Loading your progress…

Tests that can't fail — Python practice · Runtime