summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2021-01-31 12:23:10 +0200
committerRan Benita <ran@unusedvar.com>2021-02-06 20:46:08 +0200
commit5822888d735e2cd617225686611275fa8fbafbea (patch)
treebe19c6f033b97ab102ae1d64472071ef45e286e0 /src
parentf42b68ccaa4a64b3f7ef1cfcff50b4f39b63ceb9 (diff)
downloadpytest-5822888d735e2cd617225686611275fa8fbafbea.tar.gz
runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest
Diffstat (limited to 'src')
-rw-r--r--src/_pytest/runner.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/_pytest/runner.py b/src/_pytest/runner.py
index 153b134fe..e43dd2dc8 100644
--- a/src/_pytest/runner.py
+++ b/src/_pytest/runner.py
@@ -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]