Skip to content
Merged
Changes from all commits
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
8 changes: 6 additions & 2 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,10 @@ def pytest_runtest_makereport(item, call):
"""
Comment thread
Anatw marked this conversation as resolved.
if call.excinfo is not None and "incremental" in item.keywords:
parent = item.parent
parent._previousfailed = item
param_key = item.callspec.id if hasattr(item, "callspec") else ""
if not hasattr(parent, "_previousfailed"):
parent._previousfailed = {}
parent._previousfailed[param_key] = item
Comment thread
Anatw marked this conversation as resolved.

outcome = yield
report = outcome.get_result()
Expand Down Expand Up @@ -732,7 +735,8 @@ def pytest_runtest_setup(item):
BASIC_LOGGER.info(f"\n{separator(symbol_='-', val=item.name)}")
BASIC_LOGGER.info(f"{separator(symbol_='-', val='SETUP')}")
if "incremental" in item.keywords:
previousfailed = getattr(item.parent, "_previousfailed", None)
param_key = item.callspec.id if hasattr(item, "callspec") else ""
previousfailed = getattr(item.parent, "_previousfailed", {}).get(param_key)
if previousfailed is not None:
pytest.xfail("previous test failed (%s)" % previousfailed.name)

Expand Down