Skip to content

Commit 5822888

Browse files
committed
runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest
1 parent f42b68c commit 5822888

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/_pytest/runner.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ def runtestprotocol(
120120
) -> List[TestReport]:
121121
hasrequest = hasattr(item, "_request")
122122
if hasrequest and not item._request: # type: ignore[attr-defined]
123+
# This only happens if the item is re-run, as is done by
124+
# pytest-rerunfailures.
123125
item._initrequest() # type: ignore[attr-defined]
124126
rep = call_and_report(item, "setup", log)
125127
reports = [rep]

0 commit comments

Comments
 (0)