Skip to content
CodeKruPro

skip, skipif and xfail in pytest

QuizEasy-MediumPython onlyAsked in: Accenture, Capgemini

A test checks a feature that has a known open bug. The team wants the test to keep running, and wants to notice when the bug is fixed. Which marker fits?

  • @pytest.mark.xfail(reason="BUG-123")
  • @pytest.mark.skip(reason="BUG-123")
  • @pytest.mark.skipif(True, reason="BUG-123")
  • Delete the test until the bug is fixed

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in