Bird
0
0

Which of the following is the correct way to register a marker named slow in pytest.ini?

easy📝 Syntax Q12 of 15
PyTest - Markers
Which of the following is the correct way to register a marker named slow in pytest.ini?
A[markers] slow: marks tests as slow
B[pytest] markers = slow
C[pytest] slow = marks tests as slow
D[markers] slow = marks tests as slow
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct section header

    Markers must be registered under the [markers] section in pytest.ini.
  2. Step 2: Check syntax for marker registration

    The correct syntax uses an equals sign = with a description, e.g., slow = marks tests as slow.
  3. Final Answer:

    [markers] slow = marks tests as slow -> Option D
  4. Quick Check:

    Markers section + equals sign = correct syntax [OK]
Quick Trick: Use [markers] section and '=' to register markers [OK]
Common Mistakes:
MISTAKES
  • Using [pytest] instead of [markers]
  • Using colon ':' instead of '='
  • Listing markers without description

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes