tests/functional: remove all class level fields
PATCH v3 1/1 tests/functional: remove all class level fields
A number of fields are set at the class level on QemuBaseTest, even though the exact same named field is then set at the object level later in most cases.
The 'self.logger' initialization in ACPI bits test needs to be removed since 'self.log' won't exist at that point in the flow. It already initialized 'self.logger' later in the setUp() method, so the __init__ method was redundant.
--- tests/functional/qemu_test/testcase.py | 6 ------ tests/functional/test_acpi_bits.py | 1 - 2 files changed, 7 deletions(-)
tests/functional/qemu_test/testcase.py +0 -6
@@ -33,12 +33,6 @@ class QemuBaseTest(unittest.TestCase): - arch = None - - workdir = None - log = None - logdir = None - ''' @params compressed: filename, Asset, or file-like object to uncompress @params format: optional compression format (gzip, lzma)
tests/functional/test_acpi_bits.py +0 -1
@@ -119,7 +119,6 @@ def __init__(self, *args, **kwargs): self._debugcon_addr = '0x403' self._debugcon_log = 'debugcon-log.txt' - self.logger = self.log def _print_log(self, log): self.logger.info('\nlogs from biosbits follows:')
Signature · 1 line
2.48.1
Quoted 8 lines · Daniel P. Berrangé
A number of fields are set at the class level on QemuBaseTest, even though the exact same named field is then set at the object level later in most cases.
The 'self.logger' initialization in ACPI bits test needs to be removed since 'self.log' won't exist at that point in the flow. It already initialized 'self.logger' later in the
setUp()method, so the__init__method was redundant.
Thanks for tackling it!
Quoted 2 lines
Signed-off-by Daniel P. Berrangé <[email protected]>---
... and queued it!