question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--last-failed and retest on success

See original GitHub issue

I’d love some guidance on how to get pytest --last-failed to play nice with ptw. Right now, if the last failed tests succeeds, then ptw sits patiently until the next file change.

What I’d like is for it to run normally with last-failed, but when all of the last-failed tests succeed, then rerun all tests. Any suggestions?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

4reactions
carvercommented, Oct 7, 2018

The workaround I’ve been using is ptw mymodule/ tests/ -- --failed-first --exitfirst in order to quickly re-loop on failing tests, but run all the remaining tests. ( or ptw mymodule tests -- --ff -x for the code golfers)

3reactions
max-sixtycommented, Oct 8, 2018

Perfect, thanks for clarifying.

For comparison, --looponfail would do:

  • A - pass
  • B - fail
  • C - fail
  • D - fail

Then you try to fix [B], but don’t succeed. The next run is:

  • B - fail
  • C - fail
  • D - fail

Then you fix B. The next run is:

  • B - pass
  • C - fail
  • D - fail

…each run runs all the still-failing tests, until they’re all fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to re-run failed tests and maintain state between test runs
The plugin provides two command line options to rerun failures from the last pytest invocation: --lf , --last-failed - to only re-run the...
Read more >
How to Use and Improve on the Break and Retest Strategy
The Break and Retest strategy is one of the most popular strategies in the financial markets. Here's how it works and the risks...
Read more >
7 pytest Features and Plugins That Will Save You Tons of Time
These pytest tips will make your life easier. Fail fast, stop after first failure, retry last failed, and fix flaky tests with pytest-rerunfailures....
Read more >
TRADOC Regulation 350-6 Headquarters, United States Army ...
ends with the successful completion of MOS testing, demonstration of apprentice-level ... retest from progressing further in the course.
Read more >
Trans 104.12 - Wisconsin Legislature
... some other significant circumstance has changed since the last failed test or exam, which makes successful completion of the test or exam...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found