Bird
0
0

Why is it important to register custom markers in pytest's configuration file when grouping related tests?

hard🧠 Conceptual Q10 of 15
PyTest - Test Organization
Why is it important to register custom markers in pytest's configuration file when grouping related tests?
ATo disable tests marked with custom markers
BTo speed up test execution automatically
CTo avoid warnings and enable marker-based test selection
DTo allow tests to run in parallel
Step-by-Step Solution
Solution:
  1. Step 1: Understand marker registration purpose

    Registering markers avoids pytest warnings about unknown markers.
  2. Step 2: Recognize effect on test selection

    Registered markers enable filtering tests by marker with -m option.
  3. Final Answer:

    To avoid warnings and enable marker-based test selection -> Option C
  4. Quick Check:

    Register markers to use them safely and filter tests [OK]
Quick Trick: Register markers to avoid warnings and filter tests [OK]
Common Mistakes:
MISTAKES
  • Thinking registration speeds tests or disables them
  • Assuming registration controls parallelism
  • Ignoring pytest warnings about unknown markers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes