Bird
0
0

Which file should you edit to register a custom marker in pytest to avoid warnings?

easy🧠 Conceptual Q2 of 15
PyTest - Markers
Which file should you edit to register a custom marker in pytest to avoid warnings?
Aconftest.py
Bpytest.ini
Csetup.py
Drequirements.txt
Step-by-Step Solution
Solution:
  1. Step 1: Know where pytest expects marker registration

    pytest.ini is the config file for pytest settings.
  2. Step 2: Register custom markers in pytest.ini

    Adding markers in pytest.ini prevents warnings during test runs.
  3. Final Answer:

    pytest.ini -> Option B
  4. Quick Check:

    Marker registration file = pytest.ini [OK]
Quick Trick: Register markers in pytest.ini to avoid warnings [OK]
Common Mistakes:
MISTAKES
  • Registering markers in conftest.py instead
  • Editing setup.py which is unrelated
  • Trying to register markers in requirements.txt

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes