Skip to content

Commit

Permalink
Fix issue can occur when used together with pytest-flake8. (#74)
Browse files Browse the repository at this point in the history
Fixes #73.
  • Loading branch information
Michael Howitz authored Nov 6, 2018
1 parent 40bdecb commit e3f50f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Changelog

- Add support for Python 3.7.

- Fix issue can occur when used together with `pytest-flake8`
(`#73 <https://github.com/pytest-dev/pytest-rerunfailures/issues/73>`_)


4.2 (2018-10-04)
================
Expand Down
4 changes: 2 additions & 2 deletions pytest_rerunfailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ def _remove_cached_results_from_failed_fixtures(item):
Note: remove all cached_result attribute from every fixture
"""
cached_result = 'cached_result'
fixture_info = getattr(item, '_fixtureinfo')
for fixture_def_str in fixture_info.name2fixturedefs:
fixture_info = getattr(item, '_fixtureinfo', None)
for fixture_def_str in getattr(fixture_info, 'name2fixturedefs', ()):
fixture_defs = fixture_info.name2fixturedefs[fixture_def_str]
for fixture_def in fixture_defs:
if hasattr(fixture_def, cached_result):
Expand Down

0 comments on commit e3f50f8

Please sign in to comment.