robot.output.console package
- robot.output.console.ConsoleOutput(console: Literal['VERBOSE', 'DOTTED', 'QUIET', 'NONE'] | object = 'VERBOSE', width: int = 78, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO', markers: Literal['AUTO', 'ON', 'OFF'] = 'AUTO', stdout: TextIOBase | None = None, stderr: TextIOBase | None = None)[source]
Submodules
robot.output.console.base module
- class robot.output.console.base.BaseConsole(width: int = 78, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO', stdout: TextIOBase | None = None, stderr: TextIOBase | None = None)[source]
Bases:
objectBase class for built-in console loggers that also external loggers can use.
Writes warnings and errors to the stderr and result file paths to the stdout by default. That can be changed by overriding relevant methods. More functionality can be added by implementing needed listener interface methods.
Public methods and attributes are part of the stable API and can be used by extending classes. Anything private (i.e. starting with an underscore) may change between releases.
Supports all the same hook methods that the listener API supports.
New in Robot Framework 7.5.
- output_file(path: Path | None)[source]
Hook method to handle output files.
Called when the output file is finished, even if the output file would be disabled. Calls
result_file()by default.
- result_file(kind: ResultFile, path: Path | None)[source]
Hook method to handle other result files than the output file.
Called when result files are finished unless they are disabled.
- write(text: str, stderr: bool = False, flush: bool = True)[source]
Write given text to stdout or stderr.
- Parameters:
text – Text to write to stdout/stderr.
stderr – When true, write to stderr instead of stdout.
flush – When true, stream is flushed after writing to it.
- highlight(status: Literal['PASS', 'FAIL', 'SKIP', 'ERROR', 'WARN'], text: str | None = None, stderr: bool = False, flush: bool = True)[source]
Highlight given status or text.
- Parameters:
status – Status marker.
text – Text to highlight. If not given, highlights the status text.
stderr – When true, write to stderr instead of stdout.
flush – When true, stream is flushed after writing to it.
robot.output.console.dotted module
- class robot.output.console.dotted.DottedConsole(width: int = 78, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO', stdout: TextIOBase | None = None, stderr: TextIOBase | None = None)[source]
Bases:
BaseConsoleDotted console logger.
Reports each test with “.” (PASS), “F” (FAIL) or “s” (SKIP).
robot.output.console.highlighting module
- class robot.output.console.highlighting.HighlightingStream(stream: TextIOBase | None, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO')[source]
Bases:
object
- class robot.output.console.highlighting.NullStream[source]
Bases:
TextIOBase
- class robot.output.console.highlighting.Highlighter[source]
Bases:
ABC- classmethod from_config(stream: TextIOBase | None, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO') Highlighter[source]
- class robot.output.console.highlighting.NoHighlighting[source]
Bases:
Highlighter
- class robot.output.console.highlighting.AnsiHighlighter(stream: TextIOBase, links: bool = True)[source]
Bases:
Highlighter- GREEN = '\x1b[32m'
- RED = '\x1b[31m'
- YELLOW = '\x1b[33m'
- RESET = '\x1b[0m'
robot.output.console.quiet module
- class robot.output.console.quiet.QuietConsole(colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', stderr: TextIOBase | None = None)[source]
Bases:
BaseConsoleQuiet console logger.
Only reports warnings and errors.
- class robot.output.console.quiet.NoneConsole[source]
Bases:
BaseConsoleTotally quiet console logger.
Does not report anything, not even warnings or errors.
robot.output.console.types module
robot.output.console.verbose module
- class robot.output.console.verbose.VerboseConsole(width: int = 78, colors: Literal['AUTO', 'ON', 'OFF', 'ANSI'] = 'AUTO', links: Literal['AUTO', 'OFF'] = 'AUTO', markers: Literal['AUTO', 'ON', 'OFF'] = 'AUTO', stdout: TextIOBase | None = None, stderr: TextIOBase | None = None)[source]
Bases:
BaseConsoleVerbose console logger.
Reports started suites and tests separately.
- status_length = 8
- info(name: str, doc: str, start_suite: bool = False)[source]
Write info about started or ended suite or test.