-
Notifications
You must be signed in to change notification settings - Fork 2
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
Deprecating pytest-stepwise in favour for --last-failed -x #14
Comments
example where, at least in my view stepwise is superior to
fix test 1
to get to the next failing test i have to run with stepwise, the next run runs |
Hmm, this was the exact use-case that I thought had changed in pytest when I tested it a few weeks ago (the question came up on Twitter, so I started looking into it). Now when I try this again, however, I get the same results as you do. |
Hmm, what about opening a pytest issue to discuss this? Maybe |
well i think it does sort of work as advertised. I think the intended use-case is to first run the entire test suite, and then run with |
Ohh, that was probably what I was doing when I tested it out the previous time. I agree that it does work as advertised at the moment, even though it would be awesome to get the stepwise workflow into pytest somehow. |
what's your objection to it living as a plugin? maintenance? reach? |
I would be fine with it continue living as a plugin as long as it offers something more than pytest itself does, but mostly I think it's a really useful workflow that more people should know about. I also believe that is so close to The tweet where this started: https://twitter.com/cameronmaske/status/1023913232011087872 |
Indeed the workflow is slightly different, I did not realize the difference myself when I changed the behavior of the cache mechanism to support I think it should be simple to add a new |
Awesome 👍 I agree that this workflow is too good to not be in core. So it is a matter of transforming pytest-stepwise to a pytest PR? pytest-stepwise already have extensive pytester tests that should be helpful when moving it over. :) |
IMHO yes. @RonnyPfannschmidt any objections? |
i#m confused s to which the pytest behaviour is now - if the combination of |
am i understanding this workflow correctly as |
The way stepwise is implemented it does not care about any known failed tests, it just runs all tests and stops as soon as it encounters a failure, and saves the position where it failed so it can continue from there. The approach of |
Yep the difference is subtle at first glance, but #14 (comment) exemplifies it well. 👍 |
lest we forget, one pretty handy feature of pytest-stepwise is also the |
🎉 |
Awesome, thanks @nip3o! |
Once upon a time, quite a few pytest versions ago,
pytest-cache
was an external plugin that provided the--last-failed
flag, which ran only the failing tests from the last test run. The pytest-x
flag also existed back then, which exits the run after the first failing test. Combining these didn't work very well, which led to the birth ofpytest-stepwise
Since then the cache plugin has become integrated in pytest, and a few releases ago (I haven't been able to find an issue or PR for this), the combination of these two flags seems to work in the same way as Stepwise does - i.e. let's you run the same command multiple times and catch a failing step at a time. I have tested it out myself during the last weeks - not in detail but it works a lot better than I remember it to do.
I think that means that this plugin is not needed anymore, unless someone has a compelling use-case that is not handled by pytest itself (and then that probably means that it should be integrated into pytest rather than here).
Any thoughts or examples of use-cases where the behaviour differs?
The text was updated successfully, but these errors were encountered: