Bird
0
0

Which of the following is the correct syntax to run pytest tests marked as slow?

easy📝 Syntax Q12 of 15
PyTest - Markers
Which of the following is the correct syntax to run pytest tests marked as slow?
Apytest --marker slow
Bpytest -m slow
Cpytest -marker slow
Dpytest --m slow
Step-by-Step Solution
Solution:
  1. Step 1: Recall pytest command options

    The correct option to select tests by marker is -m, not --marker or others.
  2. Step 2: Match syntax to run tests with marker

    The correct command is pytest -m slow to run tests marked as slow.
  3. Final Answer:

    pytest -m slow -> Option B
  4. Quick Check:

    Use single dash -m for marker filter = D [OK]
Quick Trick: Use single dash -m, not --marker [OK]
Common Mistakes:
MISTAKES
  • Using --marker instead of -m
  • Adding extra dashes like --m
  • Confusing option names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes