19 from robot.utils import plural_or_not, secs_to_timestr
21 from .highlighting
import HighlightingStream
26 def __init__(self, width=78, colors='AUTO', stdout=None, stderr=None):
34 self.
_stdout_stdout.
write(
"Running suite '%s' with %d %s%s.\n"
35 % (suite.name, suite.test_count,
36 'test' if not suite.rpa
else 'task',
48 self.
_stdout_stdout.highlight(
's',
'SKIP')
49 elif test.tags.robot(
'exit'):
52 self.
_stdout_stdout.highlight(
'F',
'FAIL')
61 if msg.level
in (
'WARN',
'ERROR'):
65 self.
_stdout_stdout.
write(
'%-8s %s\n' % (name+
':', path))
76 stats = suite.statistics
77 self.
_stream_stream.
write(
"%s\nRun suite '%s' with %d %s%s in %s.\n\n"
78 % (
'=' * self.
_width_width, suite.name, stats.total,
79 'test' if not suite.rpa
else 'task',
82 self.
_stream_stream.highlight(suite.status + (
'PED' if suite.status ==
'SKIP' else 'ED'), suite.status)
86 if test.failed
and not test.tags.robot(
'exit'):
88 self.
_stream_stream.highlight(
'FAIL')
90 test.message.strip()))
Interface to ease traversing through a test suite structure.
def __init__(self, width=78, colors='AUTO', stdout=None, stderr=None)
def start_suite(self, suite)
def end_suite(self, suite)
def output_file(self, name, path)
def __init__(self, stream, width)
def visit_test(self, test)
Implements traversing through tests.
def write(msg, level='INFO', html=False)
Writes the message to the log file using the given level.
def error(msg, html=False)
Writes the message to the log file using the ERROR level.
def secs_to_timestr(secs, compact=False)
Converts time in seconds to a string representation.