_pytest.reports module¶
-
class
BaseReport
(**kw: Any)[source]¶ Bases:
object
-
longrepr
= None¶
-
longreprtext
¶ Read-only property that returns the full string representation of
longrepr
.New in version 3.0.
-
caplog
¶ Return captured log lines, if log capturing is enabled
New in version 3.5.
-
capstdout
¶ Return captured text from stdout, if capturing is enabled
New in version 3.0.
-
capstderr
¶ Return captured text from stderr, if capturing is enabled
New in version 3.0.
-
passed
¶
-
failed
¶
-
skipped
¶
-
fspath
¶
-
count_towards_summary
¶ Experimental
True
if this report should be counted towards the totals shown at the end of the test session: “1 passed, 1 failure, etc”.Note
This function is considered experimental, so beware that it is subject to changes even in patch releases.
-
head_line
¶ Experimental
Returns the head line shown with longrepr output for this report, more commonly during traceback representation during failures:
________ Test.foo ________
In the example above, the head_line is “Test.foo”.
Note
This function is considered experimental, so beware that it is subject to changes even in patch releases.
-
_to_json
()[source]¶ This was originally the serialize_report() function from xdist (ca03269).
Returns the contents of this report as a dict of builtin entries, suitable for serialization.
Experimental method.
-
classmethod
_from_json
(reportdict)[source]¶ This was originally the serialize_report() function from xdist (ca03269).
Factory method that returns either a TestReport or CollectReport, depending on the calling class. It’s the callers responsibility to know which class to pass here.
Experimental method.
-
-
class
TestReport
(nodeid, location: Tuple[str, Optional[int], str], keywords, outcome, longrepr, when, sections=(), duration=0, user_properties=None, **extra)[source]¶ Bases:
_pytest.reports.BaseReport
Basic test report object (also used for setup and teardown calls if they fail).
-
keywords
¶ a name -> value dictionary containing all keywords and markers associated with a test invocation.
-
outcome
¶ test outcome, always one of “passed”, “failed”, “skipped”.
-
user_properties
¶ user properties is a list of tuples (name, value) that holds user defined properties of the test
-
duration
¶ time it took to run just the test
-
classmethod
from_item_and_call
(item, call) → _pytest.reports.TestReport[source]¶ Factory method to create and fill a TestReport with standard item and call info.
-
-
class
CollectReport
(nodeid: str, outcome, longrepr, result: List[_pytest.nodes.Node], sections=(), **extra)[source]¶ Bases:
_pytest.reports.BaseReport
-
when
= 'collect'¶
-
location
¶
-