pytest-dev / pytest-dev/pytest
Stop testing a file on first fail
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.5k
- Forks
- 3.4k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 35
Description
What's the problem this feature will solve?
This allows me to gather all failed files quicker, I don't need to know whether the remaining tests passed in this file.
Describe the solution you'd like
This will be equivalent to the -x option, but on a per-file basis. That is, pytest stops testing this file if it has one failed test.
This can save time when running on clouds like Github Action, if it fails fast, then I'll be charged less, knowing I have to re-run them.
Alternative Solutions
I'm not sure which plugin can solve this problem.
Additional context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing pytest's existing -x option and the point where test execution advances between tests and files. Determine how a per-file stop condition would interact with existing failure handling, then add focused coverage showing that one failure stops the current file while other files can still run.
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