All quizzes
Free quiz · 43 questions in the bank

pytest quiz

Test your pytest knowledge with a free interactive quiz — 43 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What does `@pytest.mark.xfail` mean?

Questions in this quiz
  1. What does `@pytest.mark.xfail` mean?
  2. How do you provide teardown logic in a fixture?
  3. How do you assert that a function raises a specific exception?
  4. What does the `-v` flag do?
  5. How do you run only tests whose name contains a substring?
  6. How do you stop the test run at the first failure?
  7. How do you install and use pytest-cov for coverage?
  8. How does pytest discover test files by default?
  9. What is the difference between `pytest.ini`, `pyproject.toml`, and `setup.cfg` for pytest config?
  10. What is `conftest.py` used for?
  11. What are the built-in fixture scopes, from narrowest to broadest?
  12. How do you get a temporary directory unique to a test?
Gaps to close?
Read the curated pytest notes — core concepts, patterns, interview prep.
pytest notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web