Skip to content
CodeKruPro

Run only smoke tests with pytest markers

QuizEasy-MediumPython only

Tests are marked with @pytest.mark.smoke, which puts a label (a marker) on them. Which statements are true? Choose all that apply.

  • pytest -m smoke runs only the tests marked smoke
  • Markers should be registered in pytest.ini (or pyproject.toml); an unregistered marker gives a PytestUnknownMarkWarning
  • With --strict-markers, an unregistered marker makes collection (the step where pytest finds the tests) fail
  • pytest -k smoke and pytest -m smoke always select the same tests

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