From 5822888d735e2cd617225686611275fa8fbafbea Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sun, 31 Jan 2021 12:23:10 +0200 Subject: runner: add clarifying comments on why runtestprotocol re-inits the FixtureRequest --- src/_pytest/runner.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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] -- cgit v1.2.3