ui.format¶
Support for formatting test information.
Module Members¶
Classes¶
-
class
ui.format.
TestAnnouncer
(width=80, **kwargs)¶ Mixin that provides support for announcing test execution phases.
This is used by the built-in
Reporter
andLogger
classes.Arguments
- width
- The width to assume for formatting the output. This can be
modified by the
setWidth()
method.
Subclasses:
Terminal
cstest.core.log.Logger-
formatSuiteEntry
(suite, prePadLen=0) Format the text for suite entry announcement.
Return Value
The suite summary, suitably wrapped as a sequence of text lines.Arguments
- suite
- The
Suite
being announced. - prePadLen
- An number of spaces to assume are needed for indenting the text. This reduces the width used for paragraph formatting.
-
formatTestEntry
(test, status, prePadLen=0) Format the text for test entry announcement.A
Return Value
A tuple of (lines, numText, idText, dots and statusText). The lines contain the test summary, suitably wrapped.Arguments
- test
- The
Test
being announced. - prePadLen
- An number of spaces to assume are needed for indenting the text. This reduces the width used for paragraph formatting.
-
setWidth
(width) Set the text width used for formatting output.