diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/report_tests/plugin_tests/logs.py | 3 | ||||
-rw-r--r-- | tests/sos_tests.py | 25 | ||||
-rw-r--r-- | tests/unittests/option_tests.py | 2 | ||||
-rw-r--r-- | tests/unittests/plugin_tests.py | 3 |
4 files changed, 17 insertions, 16 deletions
diff --git a/tests/report_tests/plugin_tests/logs.py b/tests/report_tests/plugin_tests/logs.py index c3811b3f..2f4841fb 100644 --- a/tests/report_tests/plugin_tests/logs.py +++ b/tests/report_tests/plugin_tests/logs.py @@ -9,10 +9,9 @@ import random import os - -from sos_tests import StageOneReportTest, StageTwoReportTest from string import ascii_uppercase, digits from time import sleep +from sos_tests import StageOneReportTest, StageTwoReportTest class LogsPluginTest(StageOneReportTest): diff --git a/tests/sos_tests.py b/tests/sos_tests.py index 655a9472..a2cca0d9 100644 --- a/tests/sos_tests.py +++ b/tests/sos_tests.py @@ -6,13 +6,6 @@ # # See the LICENSE file in the source distribution for further information. - -from avocado.core.exceptions import TestSkipError -from avocado.core.output import LOG_UI -from avocado import Test -from avocado.utils import archive, process, distro, software_manager -from avocado.utils.cpu import get_arch -from avocado.utils.software_manager import distro_packages from fnmatch import fnmatch import glob @@ -24,6 +17,13 @@ import shutil import socket import re +from avocado.core.exceptions import TestSkipError +from avocado.core.output import LOG_UI +from avocado import Test +from avocado.utils import archive, process, distro, software_manager +from avocado.utils.cpu import get_arch +from avocado.utils.software_manager import distro_packages + SOS_TEST_DIR = os.path.dirname(os.path.realpath(__file__)) SOS_REPO_ROOT = os.path.realpath(os.path.join(SOS_TEST_DIR, '../')) SOS_PLUGIN_DIR = os.path.realpath( @@ -148,6 +148,8 @@ class BaseSoSTest(Test): if self._exception_expected: self.cmd_output = err.result else: + # pylint: disable=no-member + # We've already checked above for the result attribute for err msg = err.result.stderr.decode() or err.result.stdout.decode() # a little hacky, but using self.log methods here will not # print to console unless we ratchet up the verbosity for the @@ -399,6 +401,7 @@ class BaseSoSReportTest(BaseSoSTest): try: process.run(cmd, timeout=10) except Exception as err: + # pylint: disable=no-member if err.result.interrupted: self.error("Timeout while decrypting") if 'Bad session key' in err.result.stderr.decode(): @@ -473,7 +476,7 @@ class BaseSoSReportTest(BaseSoSTest): f"--tmp-dir {self.tmpdir} {self.sos_cmd}") def _execute_sos_cmd(self): - super(BaseSoSReportTest, self)._execute_sos_cmd() + super()._execute_sos_cmd() self.archive = re.findall( '/.*sosreport-.*tar.*', self.cmd_output.stdout @@ -489,7 +492,7 @@ class BaseSoSReportTest(BaseSoSTest): return None def setUp(self): - super(BaseSoSReportTest, self).setUp() + super().setUp() self.archive_path = self._get_archive_path() def get_name_in_archive(self, fname): @@ -834,12 +837,12 @@ class StageTwoReportTest(BaseSoSReportTest): self.packages['centos'] = self.packages['rhel'] self.packages['centos-stream'] = self.packages['rhel'] - super(StageTwoReportTest, self).setUp() + super().setUp() def tearDown(self): if self.end_of_test_case: self.teardown_mocking() - super(StageTwoReportTest, self).tearDown() + super().tearDown() def teardown_mocking(self): """Undo any and all mocked setup that we did for tests diff --git a/tests/unittests/option_tests.py b/tests/unittests/option_tests.py index 65b53608..a1fa4807 100644 --- a/tests/unittests/option_tests.py +++ b/tests/unittests/option_tests.py @@ -30,7 +30,7 @@ class MockPlugin(Plugin): ] def __init__(self, commons): - super(MockPlugin, self).__init__(commons=commons) + super().__init__(commons=commons) class GlobalOptionTest(unittest.TestCase): diff --git a/tests/unittests/plugin_tests.py b/tests/unittests/plugin_tests.py index 4be93780..d659fb3d 100644 --- a/tests/unittests/plugin_tests.py +++ b/tests/unittests/plugin_tests.py @@ -12,13 +12,12 @@ import shutil import random from io import StringIO - +from string import ascii_lowercase from sos.report.plugins import (Plugin, regex_findall, _mangle_command, PluginOpt) from sos.archive import TarFileArchive from sos.policies.distros import LinuxPolicy from sos.policies.init_systems import InitSystem -from string import ascii_lowercase PATH = os.path.dirname(__file__) |