pytest-dev / pytest-dev/pytest

Configurable behavior for maxfail

Open
#4,702 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: reporting type: backward compatibility type: enhancement type: feature-branch type: proposal
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

It'd be helpful if you could change pytest's behavior on a maxfail condition. Pytest currently interrupts the full test session, which can lead to misleading total results in say a junit xml file.

Specifically, if you're tracking test #s and failures over time, you'll have 0/0/100 (fail/skip/pass) tests one run, then 5/0/5 tests the next run. If they were skipped instead, you would have 5/90/5. This way, you still see that you have 100 tests total.

While I would prefer it to default to skipping the rest of the tests, I can understand that behavior might not be desireable for all current users of pytest (which is why I would think that this would be best set as an option in pytest.ini).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the maxfail condition interrupts the full test session and how resulting counts are written to a junit XML file. Determine where pytest.ini options are handled and define a configurable mode that preserves the remaining tests as skipped; done means the selected behavior produces consistent total counts without changing the existing default.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.