eradiate.testing.report.ReportLogger#
- class eradiate.testing.report.ReportLogger(use_robot=None)#
Bases:
objectSend messages and HTML fragments to the active test report.
- Parameters:
use_robot (
bool, optional) – IfTrue, forward messages to the Robot Framework logger; ifFalse, fall back to standardlogging. If unset, the Robot Framework backend is selected iff a Robot run is currently active.
Notes
Backend selection depends on an active Robot run, not merely on the
robotpackage being importable: outside of a run,robot.api.loggerforwards everything to a standard library logger, which means HTML fragments (SVG charts, xarray reprs) end up dumped in pytest’s captured-log output. Because a run may start after this object is constructed, the backend is resolved at call time.- html(fragment)#
Embed an HTML fragment in the test report.
- Parameters:
fragment (
str) – HTML fragment to embed (e.g. an<svg>chart or an xarray HTML repr).
Notes
If no report backend is active, the fragment is discarded.
- info(msg)#
Log an informational message to the test report and the console.
- Parameters:
msg (
str) – Message to log.
- warning(msg)#
Log a warning message to the test report and the console.
- Parameters:
msg (
str) – Message to log.
- property reporting#
Trueif a report backend is active, i.e. if HTML fragments are recorded instead of discarded.