eradiate.testing.report.ReportLogger#

class eradiate.testing.report.ReportLogger(use_robot=None)#

Bases: object

Send messages and HTML fragments to the active test report.

Parameters:

use_robot (bool, optional) – If True, forward messages to the Robot Framework logger; if False, fall back to standard logging. 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 robot package being importable: outside of a run, robot.api.logger forwards 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#

True if a report backend is active, i.e. if HTML fragments are recorded instead of discarded.