Bird
0
0

You wrote this in pytest.ini:

medium📝 Debug Q7 of 15
PyTest - Markers
You wrote this in pytest.ini:
[markers]
slow marks tests as slow

Why does pytest still warn about unknown marker 'slow'?
AMarker names cannot be 'slow'
BMissing '=' sign between marker name and description
CThe section header should be [pytest] not [markers]
DMarker descriptions must be in quotes
Step-by-Step Solution
Solution:
  1. Step 1: Identify syntax error in marker registration

    The line lacks '=' between 'slow' and description, causing pytest to ignore it.
  2. Step 2: Confirm correct syntax

    Correct format is slow = marks tests as slow. Quotes are optional, and section header is correct.
  3. Final Answer:

    Missing '=' sign between marker name and description -> Option B
  4. Quick Check:

    Marker syntax requires '=' [OK]
Quick Trick: Always use '=' to separate marker name and description [OK]
Common Mistakes:
MISTAKES
  • Omitting '=' sign
  • Using wrong section header
  • Adding unnecessary quotes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes