Skip to content
CodeKruPro

Session fixtures with pytest-xdist

QuizMedium-HardPython onlyAsked in: Accenture, Capgemini, Infosys, SaaS Labs, Swiggy, TCS

A scope="session" fixture seeds test data. You run pytest -n 4. How often does the fixture run?

  • Up to once per worker, so up to four times
  • Exactly once for the whole run
  • Once per test
  • Never: session fixtures are disabled with xdist

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