Bird
0
0

How can you combine markers to run tests marked either smoke or regression using pytest?

hard📝 Application Q9 of 15
Selenium Python - Test Framework Integration (pytest)
How can you combine markers to run tests marked either smoke or regression using pytest?
Apytest -m "smoke or regression"
Bpytest -m "smoke and regression"
Cpytest -m "smoke, regression"
Dpytest -m "smoke regression"
Step-by-Step Solution
Solution:
  1. Step 1: Understand marker logical OR usage

    Use 'or' to run tests matching either marker.
  2. Step 2: Identify correct command

    pytest -m "smoke or regression" runs tests marked smoke or regression.
  3. Final Answer:

    pytest -m "smoke or regression" -> Option A
  4. Quick Check:

    Use 'or' to combine markers for test runs [OK]
Quick Trick: Use 'or' to run tests with either marker [OK]
Common Mistakes:
  • Using 'and' instead of 'or' to combine markers
  • Separating markers with commas
  • Omitting logical operators

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes