Bird
0
0

Given the following pytest command in CI:

medium📝 Predict Output Q4 of 15
Selenium Python - CI/CD Integration
Given the following pytest command in CI:
pytest -n 3 --maxfail=1

What will happen when one test fails?
ATests ignore failures and continue running
BAll tests stop immediately after the first failure
CTests run sequentially after failure
DOnly the failed test stops, others continue
Step-by-Step Solution
Solution:
  1. Step 1: Understand the --maxfail option

    The --maxfail=1 option tells pytest to stop scheduling new tests after the first failure. Workers finish their current test.
  2. Step 2: Combine with parallel execution effect

    With -n 3, the worker with the failed test stops it, but other workers continue and finish their current tests. No new tests are scheduled.
  3. Final Answer:

    Only the failed test stops, others continue -> Option D
  4. Quick Check:

    --maxfail=1 lets ongoing tests finish [OK]
Quick Trick: --maxfail=1 stops new tests after failure, ongoing continue [OK]
Common Mistakes:
  • Thinking all tests stop immediately after first failure
  • Assuming tests run sequentially after failure
  • Believing failures are ignored

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes