Recall & Review
beginner
What does @pytest.mark.parametrize do in a test?
It runs the same test function multiple times with different input values, increasing test coverage by checking more cases.
Click to reveal answer
beginner
How does parametrize help find bugs?
By testing many input combinations automatically, it can reveal bugs that only happen with certain inputs.
Click to reveal answer
beginner
Why is parametrize better than writing many similar tests?
It saves time and code by reusing one test function with different data instead of writing many separate tests.
Click to reveal answer
beginner
What is a real-life example of parametrize?
Testing a calculator's add function with many pairs of numbers to check all results without writing many tests.
Click to reveal answer
intermediate
How does parametrize improve test reports?
Each input set runs as a separate test case, so reports show exactly which inputs passed or failed.
Click to reveal answer
What is the main benefit of using @pytest.mark.parametrize?
✗ Incorrect
Parametrize runs the same test function multiple times with different input values.
How does parametrize affect test coverage?
✗ Incorrect
Parametrize increases coverage by running tests with many different inputs.
Which is NOT a benefit of parametrize?
✗ Incorrect
Parametrize helps find bugs but does not fix them automatically.
What happens if one input case fails in a parametrize test?
✗ Incorrect
Each input case runs independently; failure in one does not stop others.
Which syntax correctly uses parametrize?
✗ Incorrect
Option A shows correct parametrize usage with input pairs.
Explain how @pytest.mark.parametrize helps increase test coverage.
Think about running one test many times with different data.
You got /3 concepts.
Describe the advantages of using parametrize instead of writing many similar test functions.
Consider code reuse and test clarity.
You got /4 concepts.