Bird
0
0

You want to run all tests except those marked as slow or integration. Which pytest command achieves this?

hard📝 Application Q8 of 15
Selenium Python - Test Framework Integration (pytest)
You want to run all tests except those marked as slow or integration. Which pytest command achieves this?
Apytest -m "not slow or not integration"
Bpytest -m "not (slow or integration)"
Cpytest -m "slow or integration"
Dpytest -m "slow and integration"
Step-by-Step Solution
Solution:
  1. Step 1: Understand logical operators in marker expressions

    Use 'not (slow or integration)' to exclude both markers.
  2. Step 2: Identify correct command syntax

    pytest -m "not (slow or integration)" excludes tests marked slow or integration.
  3. Final Answer:

    pytest -m "not (slow or integration)" -> Option B
  4. Quick Check:

    Use 'not (A or B)' to exclude multiple markers [OK]
Quick Trick: Use 'not (A or B)' to exclude multiple markers [OK]
Common Mistakes:
  • Using 'or' instead of 'and' between negated markers
  • Forgetting parentheses around 'slow or integration'
  • Using 'and' to exclude tests incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes