Bird
0
0

Which of the following is the correct syntax to skip a test using the named argument `reason="Not implemented yet"` using pytest?

easy📝 Syntax Q12 of 15
PyTest - Markers
Which of the following is the correct syntax to skip a test using the named argument `reason="Not implemented yet"` using pytest?
A@pytest.mark.skip_test(reason="Not implemented yet")
B@pytest.mark.skip("Not implemented yet")
C@pytest.skip(reason="Not implemented yet")
D@pytest.mark.skip(reason="Not implemented yet")
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct decorator syntax

    The correct decorator is @pytest.mark.skip with a named argument reason="...".
  2. Step 2: Check each option

    @pytest.mark.skip(reason="Not implemented yet") uses the correct decorator and named argument syntax. Others are either missing the named argument or use incorrect decorator names.
  3. Final Answer:

    @pytest.mark.skip(reason="Not implemented yet") -> Option D
  4. Quick Check:

    Use @pytest.mark.skip(reason=...) syntax [OK]
Quick Trick: Use named argument reason="..." with @pytest.mark.skip [OK]
Common Mistakes:
MISTAKES
  • Passing reason as positional argument
  • Using @pytest.skip instead of @pytest.mark.skip
  • Using wrong decorator names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes