Closed hugovk closed 4 years ago
I think something like the following would work.
def _no_xfail_rerun_filter(err, name, test, plugin):
for marker in test.iter_markers(name='xfail'):
return False
@flaky(max_runs=3, min_passes=1, rerun_filter=_no_xfail_rerun_filter)
# ...
I think you could then just define your own decorator which always passed that rerun filter.
That works, thank you!
Do you are aware of a global solution? I am using command line arguments passed to pytest
to enable flaky
, and so I cannot use a custom function to filter out XFailed
test.
I have tests which I know will fail and have marked them to
xfail
with pytest, because I'd still like them to run.However, I know they will fail, so don't need flaky to re-run these.
Here's a minimal example:
Is there a way for me to tell flaky NOT to re-run
@pytest.mark.xfail
tests?I'd prefer to have this as a global thing, rather than adding a second decorator to individual tests, if possible.
Thanks!