Skip to content

Option to rerun all tests in file with last-failed #13390

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bsipocz opened this issue Apr 23, 2025 · 2 comments · May be fixed by #13399
Open

Option to rerun all tests in file with last-failed #13390

bsipocz opened this issue Apr 23, 2025 · 2 comments · May be fixed by #13399

Comments

@bsipocz
Copy link
Contributor

bsipocz commented Apr 23, 2025

What's the problem this feature will solve?

I do use --last-failed to rerun flaky tests. This works perfectly fine in formal testing of libraries, however when I use the same machinery for jupyter notebook-based tutorials I need to rerun all previous cells, too as tests are not standalone.

(I use the nbval plugin to collect the cells as tests)

My other option would be to use pytest-rerunfailes, but that plugin reruns the failures straight away, and most of my cases are flaky as they query a remote server. So the approach of --last-failed would be preferred, aka to have a second test tun that only runs the problematic ones.

Describe the solution you'd like

Have an option to be used along with --last-failed that would collect all the tests from the files contained a failed test

Alternative Solutions

Additional context

@Tusenka
Copy link

Tusenka commented Apr 27, 2025

#13399

@RonnyPfannschmidt
Copy link
Member

The specific use case creates the need for test dependencies as the jupyter plugin isn't using subtests

At first glance it doesn't correctly genralize

Test items per design are independent and pytest core shouldn't have to handle plugins that don't respect that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants