runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest

This commit is contained in:
Ran Benita 2021-01-31 12:23:10 +02:00
parent f42b68ccaa
commit 5822888d73
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ def runtestprotocol(
) -> List[TestReport]:
hasrequest = hasattr(item, "_request")
if hasrequest and not item._request: # type: ignore[attr-defined]
# This only happens if the item is re-run, as is done by
# pytest-rerunfailures.
item._initrequest() # type: ignore[attr-defined]
rep = call_and_report(item, "setup", log)
reports = [rep]