Bird
0
0

You want to register two markers in pytest.ini: db for database tests and ui for user interface tests. Which pytest.ini content correctly registers both markers?

hard📝 framework Q15 of 15
PyTest - Markers
You want to register two markers in pytest.ini: db for database tests and ui for user interface tests. Which pytest.ini content correctly registers both markers?
A[markers] db = marks tests as database tests ui = marks tests as user interface tests
B[pytest] markers = db, ui
C[markers] db: marks database tests ui: marks UI tests
D[pytest] db = database tests ui = UI tests
Step-by-Step Solution
Solution:
  1. Step 1: Confirm correct section header

    Markers must be under the [markers] section, not [pytest].
  2. Step 2: Verify correct syntax for each marker

    Each marker line uses = with a description, e.g., db = marks tests as database tests.
  3. Step 3: Check all markers are listed separately

    Both db and ui markers are listed on separate lines with descriptions.
  4. Final Answer:

    [markers] db = marks tests as database tests ui = marks tests as user interface tests -> Option A
  5. Quick Check:

    Separate lines under [markers] with '=' for each marker [OK]
Quick Trick: List each marker under [markers] with '=' and description [OK]
Common Mistakes:
MISTAKES
  • Using [pytest] instead of [markers]
  • Using commas to list markers
  • Using ':' instead of '='

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes