Bird
0
0

You want to run tests marked with fast but accidentally wrote pytest -m fas. What will happen?

medium📝 Debug Q7 of 15
PyTest - Markers
You want to run tests marked with fast but accidentally wrote pytest -m fas. What will happen?
AAll tests will run ignoring the marker
BNo tests will run because no marker matches 'fas'
CTests marked with 'fast' will run anyway
Dpytest will raise a syntax error
Step-by-Step Solution
Solution:
  1. Step 1: Understand marker matching

    pytest matches markers exactly; 'fas' does not match 'fast'.
  2. Step 2: Result of no matching tests

    If no tests match the marker, pytest runs zero tests.
  3. Final Answer:

    No tests will run because no marker matches 'fas' -> Option B
  4. Quick Check:

    Marker names must match exactly to run tests [OK]
Quick Trick: Typos in marker names cause zero tests to run [OK]
Common Mistakes:
MISTAKES
  • Assuming pytest auto-corrects marker names
  • Expecting all tests to run if marker is wrong
  • Thinking pytest raises syntax errors for wrong markers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes