Bird
0
0

Why would a tester use @pytest.mark.skip(reason="...") in their test suite?

easy🧠 Conceptual Q1 of 15
PyTest - Markers
Why would a tester use @pytest.mark.skip(reason="...") in their test suite?
ATo run a test multiple times
BTo automatically fix failing tests
CTo temporarily disable a test with an explanation
DTo mark a test as expected to fail
Step-by-Step Solution
Solution:
  1. Step 1: Understand the decorator

    @pytest.mark.skip is used to skip tests.
  2. Step 2: Reason argument

    The reason argument provides a message explaining why the test is skipped.
  3. Final Answer:

    To temporarily disable a test with an explanation -> Option C
  4. Quick Check:

    Skipping disables test execution with a reason [OK]
Quick Trick: Skip disables test with a reason [OK]
Common Mistakes:
MISTAKES
  • Confusing skip with xfail
  • Using skip without a reason
  • Thinking skip fixes tests

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes