From 3129d6052d973bcbf744d962232945c0872fc73f Mon Sep 17 00:00:00 2001 From: Hugo Date: Sun, 23 Aug 2020 12:11:07 +0300 Subject: [PATCH] Run xfail tests only once: no point re-running --- tests/test_pylast.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_pylast.py b/tests/test_pylast.py index 730d39d..9ed1c7f 100755 --- a/tests/test_pylast.py +++ b/tests/test_pylast.py @@ -40,7 +40,12 @@ class PyLastTestCase: assert str.endswith(suffix, start, end) -@flaky(max_runs=3, min_passes=1) +def _no_xfail_rerun_filter(err, name, test, plugin): + for _ in test.iter_markers(name="xfail"): + return False + + +@flaky(max_runs=3, min_passes=1, rerun_filter=_no_xfail_rerun_filter) class TestPyLastWithLastFm(PyLastTestCase): secrets = None