MatrixTest.Printers¶
This module include variants of print function. They are necessary to support log to file
feature.
Also, support colored output in console.
- MatrixTest.Printers.print_aborted(fd: Optional[TextIO] = None)[source]¶
Print in
red
color (ASCII code =[91m
) and exit with return code 1. The color will be recovered to normal before this function returns.- Parameters
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.
- MatrixTest.Printers.print_error(msg: str, fd: Optional[TextIO] = None)[source]¶
Print in
red
color (ASCII code =[91m
). The color will be recovered to normal before this function returns.- Parameters
msg – The message to be printed.
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.
- Returns
None
- MatrixTest.Printers.print_info(msg: str, fd: Optional[TextIO] = None)[source]¶
Print with prefix
INFO:
- Parameters
msg – The message to be printed.
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.
- Returns
- MatrixTest.Printers.print_ok(msg: str = 'OK.', fd: Optional[TextIO] = None) → None[source]¶
Print in
green
color (ASCII code =[92m
) color. The color will be recovered to normal before this function returns.- Parameters
msg – The message to be printed.
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.
- Returns
None
- MatrixTest.Printers.print_plain(msg: str, fd: Optional[TextIO] = None, end: str = '\n')[source]¶
Just print.
- Parameters
msg – The message to be printed.
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.end – Same as the built-in
print()
.
- Returns
- MatrixTest.Printers.print_warning(msg: str, fd: Optional[TextIO] = None)[source]¶
Print in
yellow
color (ASCII code =[93m
). The color will be recovered to normal before this function returns.- Parameters
msg – The message to be printed.
fd – If given, write the output also to the file. See also
MatrixTestRunner.run()
.
- Returns
None