box / flaky

Plugin for nose or pytest that automatically reruns flaky tests.
Apache License 2.0
381 stars 59 forks source link

Ability to provide a rerun_filter to work with the force-flaky option #160

Open mentaal opened 5 years ago

mentaal commented 5 years ago

In the case of when the user is using force-flaky, it would be useful to be able to provide a filter function as well that can be used globally.

I was able to do it with a bit of a hack for the moment:

def pytest_configure(config):
    flaky_inst = config.pluginmanager.getplugin("flaky").PLUGIN
    flaky_inst._make_test_flaky = partial(flaky_inst._make_test_flaky,
                                          rerun_filter=should_rerun)
jithintomz commented 4 years ago

@mentaal this solution is not working when I tried. Is this still working for you?