MCPcopy Create free account
hub / github.com/pytest-dev/pytest / __init__

Method __init__

src/_pytest/reports.py:253–302  ·  view source on GitHub ↗
(
        self,
        nodeid: str,
        location: Tuple[str, Optional[int], str],
        keywords,
        outcome: "Literal['passed', 'failed', 'skipped']",
        longrepr: Union[
            None, ExceptionInfo[BaseException], Tuple[str, int, str], str, TerminalRepr
        ],
        when: "Literal['setup', 'call', 'teardown']",
        sections: Iterable[Tuple[str, str]] = (),
        duration: float = 0,
        user_properties: Optional[Iterable[Tuple[str, object]]] = None,
        **extra,
    )

Source from the content-addressed store, hash-verified

251 __test__ = False
252
253 def __init__(
254 self,
255 nodeid: str,
256 location: Tuple[str, Optional[int], str],
257 keywords,
258 outcome: "Literal['passed', 'failed', 'skipped']",
259 longrepr: Union[
260 None, ExceptionInfo[BaseException], Tuple[str, int, str], str, TerminalRepr
261 ],
262 when: "Literal['setup', 'call', 'teardown']",
263 sections: Iterable[Tuple[str, str]] = (),
264 duration: float = 0,
265 user_properties: Optional[Iterable[Tuple[str, object]]] = None,
266 **extra,
267 ) -> None:
268 #: Normalized collection nodeid.
269 self.nodeid = nodeid
270
271 #: A (filesystempath, lineno, domaininfo) tuple indicating the
272 #: actual location of a test item - it might be different from the
273 #: collected one e.g. if a method is inherited from a different module.
274 self.location: Tuple[str, Optional[int], str] = location
275
276 #: A name -> value dictionary containing all keywords and
277 #: markers associated with a test invocation.
278 self.keywords = keywords
279
280 #: Test outcome, always one of "passed", "failed", "skipped".
281 self.outcome = outcome
282
283 #: None or a failure representation.
284 self.longrepr = longrepr
285
286 #: One of 'setup', 'call', 'teardown' to indicate runtest phase.
287 self.when = when
288
289 #: User properties is a list of tuples (name, value) that holds user
290 #: defined properties of the test.
291 self.user_properties = list(user_properties or [])
292
293 #: Tuples of str ``(heading, content)`` with extra information
294 #: for the test report. Used by pytest to add text captured
295 #: from ``stdout``, ``stderr``, and intercepted logging events. May
296 #: be used by other plugins to add arbitrary information to reports.
297 self.sections = list(sections)
298
299 #: Time it took to run just the test.
300 self.duration = duration
301
302 self.__dict__.update(extra)
303
304 def __repr__(self) -> str:
305 return "<{} {!r} when={!r} outcome={!r}>".format(

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected