diff --git a/pytest.ini b/pytest.ini index 7edf0a2e7..a7e0df881 100644 --- a/pytest.ini +++ b/pytest.ini @@ -16,6 +16,7 @@ markers = pyqt531_or_newer: Needs PyQt 5.3.1 or newer. xfail_norun: xfail the test with out running it ci: Tests which should only run on CI. + flaky_once: Try to rerun this test once if it fails qt_log_level_fail = WARNING qt_log_ignore = ^SpellCheck: .* diff --git a/tests/conftest.py b/tests/conftest.py index 4008f9c5b..c5e6aa08f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -113,6 +113,8 @@ def pytest_collection_modifyitems(items): _apply_platform_markers(item) if item.get_marker('xfail_norun'): item.add_marker(pytest.mark.xfail(run=False)) + if item.get_marker('flaky_once'): + item.add_marker(pytest.mark.flaky(reruns=1)) def pytest_ignore_collect(path): diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 65b0293d7..7eebb063f 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -33,6 +33,7 @@ Feature: Page history Then the history file should contain: http://localhost:(port)/data/%C3%A4%C3%B6%C3%BC.html Chäschüechli + @flaky_once Scenario: History with an error When I run :open file:///does/not/exist And I wait for "Error while loading file:///does/not/exist: Error opening /does/not/exist: *" in the log