Bird
0
0

Which of the following is a valid way to mark a test with the label regression in pytest?

easy📝 Conceptual Q2 of 15
Selenium Python - Test Framework Integration (pytest)
Which of the following is a valid way to mark a test with the label regression in pytest?
A@pytest.label('regression')
B@test.mark('regression')
C@mark('regression')
D@pytest.mark.regression
Step-by-Step Solution
Solution:
  1. Step 1: Recall pytest marker syntax

    Pytest uses @pytest.mark. to mark tests.
  2. Step 2: Match the correct syntax for 'regression'

    The correct decorator is @pytest.mark.regression.
  3. Final Answer:

    @pytest.mark.regression -> Option D
  4. Quick Check:

    Correct marker syntax = B [OK]
Quick Trick: Use @pytest.mark.markername to mark tests [OK]
Common Mistakes:
  • Using @pytest.label instead of @pytest.mark
  • Omitting 'pytest' prefix
  • Using incorrect decorator names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes