Bird
0
0

What does the @pytest.mark.skip marker do in a test?

easy🧠 Conceptual Q11 of 15
PyTest - Markers
What does the @pytest.mark.skip marker do in a test?
AIt retries the test multiple times before failing.
BIt runs the test only if a condition is true.
CIt marks the test as expected to fail but still runs it.
DIt always skips the test, so it does not run.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of @pytest.mark.skip

    This marker tells pytest to skip the test unconditionally, so the test is not executed at all.
  2. Step 2: Compare with other markers

    skipif skips conditionally, and xfail marks expected failures but runs the test. So only skip always skips.
  3. Final Answer:

    It always skips the test, so it does not run. -> Option D
  4. Quick Check:

    @pytest.mark.skip always skips = D [OK]
Quick Trick: Skip always means test won't run at all [OK]
Common Mistakes:
MISTAKES
  • Confusing skip with skipif (conditional skip)
  • Thinking xfail skips the test
  • Assuming skip reruns the test

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes