Closed Chuckv closed 5 years ago
Edit: I'm looking into it more closely. There's some shenanigans with how flaky looks at whether tests pass/fail.
As an alternative, pytest-rerunfailures definitely works with it. It'll take some time to sort out what flaky is doing though.
After further review, flaky will only rerun if a test raises an exception. Most of the time this is indeed the case, but for pytest.assume we don't want to raise an exception during the test -- instead we complete the test & set the report to failed afterwards.
I'll look into whether this is possible to be fixed... but no guarantees.
at my workplace we have several hundred tests that use @flaky decorators (mostly I think due to sauce and networking issues) so it would be really nice if this could work with that.. I don't see us wanting to change over to pytest-rerunfailures unless it also offers advantages over flaky
Can you give the branch https://github.com/astraw38/pytest-assume/tree/use_new_hook here a trial to see if it works for your setup?
I did my best to verify locally w/ flaky, but it's got some bleedthrough with pytester (and doesn't fully seem to fully disable itself even with `-p no:flaky
).
how do I make use of that branch? (sorry, not very familiar with pytest plugins) is there a way to install it with pip? (I'm a bit of a newbie when it comes to python)
pip install git+https://github.com/astraw38/pytest-assume@use_new_hook
It should install pytest-assume version 2.0.0 (which you can use to verify via pip show pytest-assume
)
Oh thanks, so I can use pip, cool. will try to have a look shortly..
Closing -- merged in #16 which should fix this.
This plugin does not work for tests which are being re-run on assert failure via the Flaky plugin.
Install flaky plugin and then try the following
The result that I got: