Skip to content

Commit

Permalink
Mark tests which use the graph_cases as "flaky" (pytest-rerunfailures)
Browse files Browse the repository at this point in the history
Related to #4
  • Loading branch information
nicoddemus committed May 18, 2017
1 parent 5dadc51 commit e167717
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- pytest-qt
- pytest-selenium
- pytest-mock
- pytest-rerunfailures
- pytest-xdist
- pytest-xvfb

13 changes: 13 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e167717

Please sign in to comment.