Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Features
- Add support for Python 3.9.
(Thanks to `@digitronik`_ for the PR)

- Add support for pytest 6.3.
(Thanks to `@bluetech`_ for the PR)

Other changes
+++++++++++++

Expand All @@ -26,6 +29,7 @@ Other changes

.. _@BeyondEvil: https://github.com/BeyondEvil
.. _@digitronik: https://github.com/digitronik
.. _@bluetech: https://github.com/bluetech

9.1.1 (2020-09-29)
------------------
Expand Down
22 changes: 14 additions & 8 deletions pytest_rerunfailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
pytest.__version__
) >= pkg_resources.parse_version("5.4")

PYTEST_GTE_63 = pkg_resources.parse_version(
pytest.__version__
) >= pkg_resources.parse_version("6.3.0.dev")


def works_with_current_xdist():
"""Returns compatibility with installed pytest-xdist version.
Expand Down Expand Up @@ -205,15 +209,17 @@ def _remove_cached_results_from_failed_fixtures(item):

def _remove_failed_setup_state_from_session(item):
"""
Note: remove all _prepare_exc attribute from every col in stack of
_setupstate and cleaning the stack itself
Note: remove all failures from every node in _setupstate stack
and clean the stack itself
"""
prepare_exc = "_prepare_exc"
setup_state = getattr(item.session, "_setupstate")
for col in setup_state.stack:
if hasattr(col, prepare_exc):
delattr(col, prepare_exc)
setup_state.stack = list()
setup_state = item.session._setupstate
if PYTEST_GTE_63:
setup_state.stack = {}
else:
for node in setup_state.stack:
if hasattr(node, "_prepare_exc"):
del node._prepare_exc
setup_state.stack = []


def _should_hard_fail_on_error(session_config, report):
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ deps =
pytest54: pytest==5.4.*
pytest60: pytest==6.0.*
pytest61: pytest==6.1.*
pytest62: pytest==6.2.*
pytestmaster: git+https://github.com/pytest-dev/pytest.git@master#egg=pytest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like testing against master.
This change should also be applied to .github/workflows/test.yml so CI runs them, too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, added. Using master might of course cause breakage from the pytest side, but hopefully not.


[testenv:linting]
basepython = python3
Expand Down