pytest-dev / pytest-dev/pytest

Flag to run tests based on the summary output of a previous run

Open
#12,619 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: proposal
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?

A common workflow is to re-run locally tests that have failed on CI. When there are a number of failures, it is not straightforward to do so, as it requires a lot of copy/paste test ids.

Describe the solution you'd like

If the user is running with -ra on CI, the summary output could be used as input to pytest to only run the failed tests. Then the user can copy/paste the summary output into a file, and call pytest with -x/--sw in order to resolve the tests bit by bit locally.

I think this could be done via a flag:

  • --from-summary-output=file.txt
  • --from-summary=file.txt

We don't need a short version for this flag I believe.

Additional context

Idea came from this discussion in the mailing list.

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 reading pytest's -ra summary output and the existing -x/--sw command-line behavior. Determine how a file containing summary output could identify failed tests, then verify that the proposed flag runs only those tests and works with the existing stopping options.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.