diff options
author | Ran Benita <ran@unusedvar.com> | 2021-01-31 12:23:10 +0200 |
---|---|---|
committer | Ran Benita <ran@unusedvar.com> | 2021-02-06 20:46:08 +0200 |
commit | 5822888d735e2cd617225686611275fa8fbafbea (patch) | |
tree | be19c6f033b97ab102ae1d64472071ef45e286e0 | |
parent | f42b68ccaa4a64b3f7ef1cfcff50b4f39b63ceb9 (diff) | |
download | pytest-5822888d735e2cd617225686611275fa8fbafbea.tar.gz |
runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest
-rw-r--r-- | src/_pytest/runner.py | 2 |
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] |