test: fix pylint errors in multiplexed_log.py

* don't inherit from object
* remove superfluous comprehension
* add module docstring

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Heinrich Schuchardt 2021-11-23 00:01:45 +01:00
parent 9abd2ca96e
commit 09e409810a

View file

@ -2,8 +2,10 @@
# Copyright (c) 2015 Stephen Warren # Copyright (c) 2015 Stephen Warren
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
# Generate an HTML-formatted log file containing multiple streams of data, """
# each represented in a well-delineated/-structured fashion. Generate an HTML-formatted log file containing multiple streams of data,
each represented in a well-delineated/-structured fashion.
"""
import datetime import datetime
import html import html
@ -178,7 +180,7 @@ class RunAndLog(object):
raise exception raise exception
return output return output
class SectionCtxMgr(object): class SectionCtxMgr:
"""A context manager for Python's "with" statement, which allows a certain """A context manager for Python's "with" statement, which allows a certain
portion of test code to be logged to a separate section of the log file. portion of test code to be logged to a separate section of the log file.
Objects of this type should be created by factory functions in the Logfile Objects of this type should be created by factory functions in the Logfile
@ -206,7 +208,7 @@ class SectionCtxMgr(object):
def __exit__(self, extype, value, traceback): def __exit__(self, extype, value, traceback):
self.log.end_section(self.marker) self.log.end_section(self.marker)
class Logfile(object): class Logfile:
"""Generates an HTML-formatted log file containing multiple streams of """Generates an HTML-formatted log file containing multiple streams of
data, each represented in a well-delineated/-structured fashion.""" data, each represented in a well-delineated/-structured fashion."""
@ -320,8 +322,8 @@ $(document).ready(function () {
# The set of characters that should be represented as hexadecimal codes in # The set of characters that should be represented as hexadecimal codes in
# the log file. # the log file.
_nonprint = {ord('%')} _nonprint = {ord('%')}
_nonprint.update({c for c in range(0, 32) if c not in (9, 10)}) _nonprint.update(c for c in range(0, 32) if c not in (9, 10))
_nonprint.update({c for c in range(127, 256)}) _nonprint.update(range(127, 256))
def _escape(self, data): def _escape(self, data):
"""Render data format suitable for inclusion in an HTML document. """Render data format suitable for inclusion in an HTML document.