diff --git a/environment.yml b/environment.yml index 63dce62..0fce268 100644 --- a/environment.yml +++ b/environment.yml @@ -13,6 +13,7 @@ dependencies: - pytest-qt - pytest-selenium - pytest-mock + - pytest-rerunfailures - pytest-xdist - pytest-xvfb diff --git a/tests/conftest.py b/tests/conftest.py index a5a2ea1..fdf0593 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -245,6 +245,19 @@ def graph_cases_factory(selenium): return lambda host: GraphCaseFactory(selenium=selenium, host=host) +def pytest_collection_modifyitems(items): + """ + Marks all tests which use the graph_cases fixture as "flaky". + + Unfortunately we've been unable to properly fix some flaky failures with tests using this fixture (#4)*. + + See pytest-rerunfailures plugin for more information. + """ + for item in items: + if 'graph_cases' in getattr(item, 'fixturenames', []): + item.add_marker(pytest.mark.flaky(reruns=3)) + + class GraphCaseFactory(object): """ Creates cases with graphs already preconfigured and with helper methods