From 3719ec91ceedb74f63412ef55fab68d92ea53979 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 26 Mar 2024 14:48:05 -0400 Subject: [PATCH 1/3] Makefile: do not ignore errors on requirements-dev Signed-off-by: Cleber Rosa --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 929aa005e8..677d684176 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ uninstall: $(PYTHON) setup.py develop --uninstall $(PYTHON_DEVELOP_ARGS) requirements-dev: pip - - $(PYTHON) -m pip install -r requirements-dev.txt $(PYTHON_DEVELOP_ARGS) + $(PYTHON) -m pip install -r requirements-dev.txt $(PYTHON_DEVELOP_ARGS) smokecheck: clean uninstall develop $(PYTHON) -m avocado run examples/tests/passtest.py From c485f43cb28ed05c026f3f9be6291cf4d9471c51 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Tue, 26 Mar 2024 14:49:05 -0400 Subject: [PATCH 2/3] Devel: bump psutil to match Fedora 38 packages Fedora 38 is the development image used on CI, and one that is popular for Avocado development at this time. Let's match the version of psutil available on the distro with the development requirement. This avoid the atempt to compile a custom version of psutil. Signed-off-by: Cleber Rosa --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1f291bf64a..2fa73b73cb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,7 +10,7 @@ black==22.3.0 coverage==5.5 # To run make check -psutil==5.8.0 +psutil==5.9.5 # pycdlib is an optional requirement in production # but is necessary for selftests From 77ca585f776dba3d07df81eb41d51828249d54a9 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 20 Mar 2024 17:01:30 +0000 Subject: [PATCH 3/3] Bump black from 22.3.0 to 24.3.0 Bumps [black](https://github.com/psf/black) from 22.3.0 to 24.3.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/22.3.0...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] Signed-off-by: Cleber Rosa --- avocado/core/app.py | 1 - avocado/core/dispatcher.py | 5 ----- avocado/core/exceptions.py | 15 --------------- avocado/core/output.py | 6 ------ avocado/core/parameters.py | 2 -- avocado/core/parser.py | 3 --- avocado/core/resolver.py | 3 --- avocado/core/result.py | 1 - avocado/core/settings.py | 1 - avocado/core/settings_dispatcher.py | 1 - avocado/core/status/repo.py | 6 +++--- avocado/core/sysinfo.py | 1 - avocado/core/test.py | 2 -- avocado/core/test_id.py | 1 - avocado/core/tree.py | 4 ---- avocado/core/varianter.py | 2 -- avocado/plugins/beaker_result.py | 2 +- avocado/plugins/cache.py | 1 - avocado/plugins/config.py | 1 - avocado/plugins/dict_variants.py | 1 - avocado/plugins/diff.py | 1 - avocado/plugins/distro.py | 6 ------ avocado/plugins/exec_path.py | 1 - avocado/plugins/human.py | 2 -- avocado/plugins/journal.py | 2 -- avocado/plugins/json_variants.py | 2 -- avocado/plugins/jsonresult.py | 1 - avocado/plugins/list.py | 1 - avocado/plugins/plugins.py | 1 - avocado/plugins/replay.py | 1 - avocado/plugins/resolvers.py | 2 +- avocado/plugins/run.py | 1 - avocado/plugins/sysinfo.py | 1 - avocado/plugins/tap.py | 2 -- avocado/plugins/variants.py | 1 - avocado/plugins/xunit.py | 1 - avocado/utils/archive.py | 1 - avocado/utils/cpu.py | 2 +- avocado/utils/data_structures.py | 2 -- avocado/utils/datadrainer.py | 1 - avocado/utils/distro.py | 13 ------------- avocado/utils/filelock.py | 1 - avocado/utils/gdb.py | 3 --- avocado/utils/git.py | 1 - avocado/utils/iso9660.py | 7 +------ avocado/utils/kernel.py | 1 - avocado/utils/network/ports.py | 1 - avocado/utils/output.py | 1 - avocado/utils/partition.py | 2 -- avocado/utils/path.py | 1 - avocado/utils/process.py | 2 -- avocado/utils/script.py | 2 -- avocado/utils/service.py | 5 ----- avocado/utils/software_manager/backends/apt.py | 1 - avocado/utils/software_manager/backends/base.py | 1 - avocado/utils/software_manager/backends/dnf.py | 1 - avocado/utils/software_manager/backends/dpkg.py | 1 - avocado/utils/software_manager/backends/rpm.py | 1 - avocado/utils/software_manager/backends/yum.py | 1 - avocado/utils/software_manager/backends/zypper.py | 1 - avocado/utils/software_manager/inspector.py | 1 - avocado/utils/software_manager/manager.py | 1 - avocado/utils/ssh.py | 1 + avocado/utils/stacktrace.py | 1 + avocado/utils/sysinfo.py | 6 ------ contrib/containers/ci/selftests/fedora-38.docker | 2 +- docs/source/conf.py | 2 +- .../plugins/tests/magic/avocado_magic/resolver.py | 2 +- examples/tests/abort.py | 1 - examples/tests/cabort.py | 1 - examples/tests/cancel_on_exception.py | 1 - examples/tests/cancel_test.py | 1 - examples/tests/cancelonsetup.py | 1 - examples/tests/canceltest.py | 1 - examples/tests/cit_parameters.py | 1 - examples/tests/datadir.py | 1 - examples/tests/doublefail.py | 1 - examples/tests/errortest.py | 1 - examples/tests/errortest_nasty.py | 2 -- examples/tests/errortest_nasty2.py | 2 -- examples/tests/errortest_nasty3.py | 2 -- examples/tests/fail_on_exception.py | 1 - examples/tests/failtest.py | 1 - examples/tests/failtest_ugly.py | 1 + examples/tests/failtest_with_warning.py | 1 - examples/tests/gdbtest.py | 1 - examples/tests/gendata.py | 1 - examples/tests/linuxbuild.py | 1 - examples/tests/modify_variable.py | 1 - examples/tests/multiple_tests.py | 1 - examples/tests/multiplextest.py | 1 - examples/tests/passtest.py | 1 - examples/tests/passtest_with_dependency.py | 1 - examples/tests/phases.py | 1 - examples/tests/raise.py | 1 - examples/tests/sleeptenmin.py | 1 - examples/tests/sleeptest.py | 1 - examples/tests/sleeptest_async.py | 1 - examples/tests/timeouttest.py | 1 - examples/tests/uncaught_exception.py | 1 - examples/tests/warntest.py | 1 - examples/tests/whiteboard.py | 1 - .../html/avocado_result_html/__init__.py | 3 --- .../avocado_result_upload/result_upload.py | 2 -- .../resultsdb/avocado_resultsdb/resultsdb.py | 3 --- .../avocado_varianter_cit/CombinationRow.py | 1 - .../avocado_varianter_cit/varianter_cit.py | 2 -- optional_plugins/varianter_cit/tests/solver.py | 1 - .../avocado_varianter_pict/varianter_pict.py | 2 -- .../avocado_varianter_yaml_to_mux/mux.py | 6 ------ .../varianter_yaml_to_mux.py | 5 ----- requirements-dev.txt | 2 +- selftests/.data/get_data.py | 1 - selftests/.data/whiteboard.py | 1 - selftests/functional/fetch_asset.py | 1 - selftests/functional/lv_utils.py | 1 - selftests/functional/plugin/assets.py | 1 - selftests/functional/serial/requirements.py | 1 - selftests/style.sh | 2 +- selftests/unit/plugin/resolver.py | 1 - selftests/unit/safeloader_core.py | 1 - selftests/unit/utils/data_structures.py | 1 - selftests/unit/utils/iso9660.py | 6 +----- selftests/unit/utils/partition.py | 3 --- selftests/unit/utils/stacktrace.py | 1 - 125 files changed, 16 insertions(+), 223 deletions(-) diff --git a/avocado/core/app.py b/avocado/core/app.py index a68aafb58f..7973e759e7 100644 --- a/avocado/core/app.py +++ b/avocado/core/app.py @@ -29,7 +29,6 @@ class AvocadoApp: - """ Avocado application. """ diff --git a/avocado/core/dispatcher.py b/avocado/core/dispatcher.py index 2f00ffea2f..8b265aa547 100644 --- a/avocado/core/dispatcher.py +++ b/avocado/core/dispatcher.py @@ -53,7 +53,6 @@ def get_dispatchers(module_name): class CLIDispatcher(EnabledExtensionManager): - """ Calls extensions on configure/run @@ -68,7 +67,6 @@ def __init__(self): class CLICmdDispatcher(EnabledExtensionManager): - """ Calls extensions on configure/run @@ -83,7 +81,6 @@ def __init__(self): class JobPrePostDispatcher(EnabledExtensionManager): - """ Calls extensions before Job execution @@ -100,7 +97,6 @@ def __init__(self): class TestPreDispatcher(EnabledExtensionManager): - """ Calls extensions before Test execution @@ -115,7 +111,6 @@ def __init__(self): class TestPostDispatcher(EnabledExtensionManager): - """ Calls extensions after Test execution diff --git a/avocado/core/exceptions.py b/avocado/core/exceptions.py index 16e51256c4..66119df0ff 100644 --- a/avocado/core/exceptions.py +++ b/avocado/core/exceptions.py @@ -18,7 +18,6 @@ class JobBaseException(Exception): - """ The parent of all job exceptions. @@ -27,42 +26,36 @@ class JobBaseException(Exception): class JobError(JobBaseException): - """ A generic error happened during a job execution. """ class JobTestSuiteError(JobBaseException): - """ Generic error happened during the creation of a job's test suite """ class JobTestSuiteEmptyError(JobTestSuiteError): - """ Error raised when the creation of a test suite results in an empty suite """ class JobTestSuiteDuplicateNameError(JobTestSuiteError): - """ Error raised when a test suite name is not unique in a job """ class JobTestSuiteReferenceResolutionError(JobTestSuiteError): - """ Test References did not produce a valid reference by any resolver """ class JobFailFast(JobBaseException): - """ Indicates that the test has failed because failfast is enabled. @@ -72,14 +65,12 @@ class JobFailFast(JobBaseException): class OptionValidationError(Exception): - """ An invalid option was passed to the test runner """ class TestBaseException(Exception): - """ The parent of all test exceptions. @@ -91,7 +82,6 @@ class TestBaseException(Exception): class TestSetupFail(TestBaseException): - """ Indicates an error during a setup or cleanup procedure. """ @@ -100,7 +90,6 @@ class TestSetupFail(TestBaseException): class TestError(TestBaseException): - """ Indicates that the test was not fully executed and an error happened. @@ -113,7 +102,6 @@ class TestError(TestBaseException): class TestAbortError(TestBaseException): - """ Indicates that the test was prematurely aborted. """ @@ -122,7 +110,6 @@ class TestAbortError(TestBaseException): class TestSkipError(TestBaseException): - """ Indicates that the test is skipped. @@ -135,7 +122,6 @@ class TestSkipError(TestBaseException): class TestFail(TestBaseException, AssertionError): - """ Indicates that the test failed. @@ -148,7 +134,6 @@ class TestFail(TestBaseException, AssertionError): class TestWarn(TestBaseException): - """ Indicates that bad things (may) have happened, but not an explicit failure. diff --git a/avocado/core/output.py b/avocado/core/output.py index da61df1d8f..82f4718427 100644 --- a/avocado/core/output.py +++ b/avocado/core/output.py @@ -248,7 +248,6 @@ def warn_str(self, msg="WARN", move=MOVE_BACK): class _StdOutputFile: - """ File-like object which stores (_is_stdout, content) into the provided list """ @@ -299,7 +298,6 @@ def getvalue(self): class StdOutput: - """ Class to modify sys.stdout/sys.stderr """ @@ -576,7 +574,6 @@ def filter(self, record): class ProgressStreamHandler(logging.StreamHandler): - """ Handler class that allows users to skip new lines on each emission. """ @@ -607,7 +604,6 @@ def emit(self, record): class MemStreamHandler(logging.StreamHandler): - """ Handler that stores all records in self.log (shared in all instances) """ @@ -624,7 +620,6 @@ def flush(self): class Paginator: - """ Paginator that uses less to display contents on the terminal. @@ -722,7 +717,6 @@ def disable_log_handler(logger): class Throbber: - """ Produces a spinner used to notify progress in the application UI. """ diff --git a/avocado/core/parameters.py b/avocado/core/parameters.py index c7583db565..0c9b6aecf2 100644 --- a/avocado/core/parameters.py +++ b/avocado/core/parameters.py @@ -24,7 +24,6 @@ class NoMatchError(KeyError): class AvocadoParams: - """ Params object used to retrieve params from given path. It supports absolute and relative paths. For relative paths one can define multiple @@ -199,7 +198,6 @@ def iteritems(self): class AvocadoParam: - """ This is a single slice params. It can contain multiple leaves and tries to find matching results. diff --git a/avocado/core/parser.py b/avocado/core/parser.py index 56135bf654..bb640694a8 100644 --- a/avocado/core/parser.py +++ b/avocado/core/parser.py @@ -32,7 +32,6 @@ class ArgumentParser(argparse.ArgumentParser): - """ Class to override argparse functions """ @@ -52,7 +51,6 @@ def _get_option_tuples(self, option_string): class FileOrStdoutAction(argparse.Action): - """ Controls claiming the right to write to the application standard output """ @@ -74,7 +72,6 @@ def __call__(self, parser, namespace, values, option_string=None): class Parser: - """ Class to Parse the command line arguments. """ diff --git a/avocado/core/resolver.py b/avocado/core/resolver.py index 96632e3f17..681d5b890c 100644 --- a/avocado/core/resolver.py +++ b/avocado/core/resolver.py @@ -55,7 +55,6 @@ class ReferenceResolutionAction(Enum): class ReferenceResolution: - """ Represents one complete reference resolution @@ -99,7 +98,6 @@ def __repr__(self): class Resolver(EnabledExtensionManager): - """ Main test reference resolution utility. @@ -143,7 +141,6 @@ def resolve(self, reference): class Discoverer(EnabledExtensionManager): - """ Secondary test reference resolution utility. diff --git a/avocado/core/result.py b/avocado/core/result.py index 7275086c32..a1bb8f0520 100644 --- a/avocado/core/result.py +++ b/avocado/core/result.py @@ -19,7 +19,6 @@ class Result: - """ Result class, holder for job (and its tests) result information. """ diff --git a/avocado/core/settings.py b/avocado/core/settings.py index 2187e3d624..46b2ebb894 100644 --- a/avocado/core/settings.py +++ b/avocado/core/settings.py @@ -59,7 +59,6 @@ class SettingsError(Exception): class ConfigFileNotFound(SettingsError): - """ Error thrown when the main settings file could not be found. """ diff --git a/avocado/core/settings_dispatcher.py b/avocado/core/settings_dispatcher.py index 1f775835a3..cb89e9ea17 100644 --- a/avocado/core/settings_dispatcher.py +++ b/avocado/core/settings_dispatcher.py @@ -24,7 +24,6 @@ class SettingsDispatcher(ExtensionManager): - """ Dispatchers that allows plugins to modify settings diff --git a/avocado/core/status/repo.py b/avocado/core/status/repo.py index bfd56b9ded..dcd750332d 100644 --- a/avocado/core/status/repo.py +++ b/avocado/core/status/repo.py @@ -43,9 +43,9 @@ def _handle_task_finished(self, message): if result is not None and result.upper() not in STATUSES: overridden = "error" message["result"] = overridden - message[ - "fail_reason" - ] = f'Runner error occurred: Test reports unsupported status "{result}"' + message["fail_reason"] = ( + f'Runner error occurred: Test reports unsupported status "{result}"' + ) LOG.error( 'Task "%s" finished message with unsupported status ' '"%s", changing to "%s"', diff --git a/avocado/core/sysinfo.py b/avocado/core/sysinfo.py index 57726ee2f2..cba1bfe51a 100644 --- a/avocado/core/sysinfo.py +++ b/avocado/core/sysinfo.py @@ -46,7 +46,6 @@ def gather_collectibles_config(config): class SysInfo: - """ Log different system properties at some key control points. diff --git a/avocado/core/test.py b/avocado/core/test.py index 1246145cb9..eb79e2960e 100644 --- a/avocado/core/test.py +++ b/avocado/core/test.py @@ -69,7 +69,6 @@ class TestData: - """ Class that adds the ability for tests to have access to data files @@ -220,7 +219,6 @@ def get_data(self, filename, source=None, must_exist=True): class Test(unittest.TestCase, TestData): - """ Base implementation for the test class. diff --git a/avocado/core/test_id.py b/avocado/core/test_id.py index 93f751d01f..9bf1bfb3d0 100644 --- a/avocado/core/test_id.py +++ b/avocado/core/test_id.py @@ -2,7 +2,6 @@ class TestID: - """ Test ID construction and representation according to specification diff --git a/avocado/core/tree.py b/avocado/core/tree.py index 74082d933b..387b6a5439 100644 --- a/avocado/core/tree.py +++ b/avocado/core/tree.py @@ -42,7 +42,6 @@ class FilterSet(set): - """Set of filters in standardized form""" @staticmethod @@ -63,7 +62,6 @@ def __str__(self): class TreeEnvironment(dict): - """TreeNode environment with values, origins and filters""" def __init__(self): @@ -127,7 +125,6 @@ def sort_fn(x): class TreeNodeEnvOnly: - """ Minimal TreeNode-like class providing interface for AvocadoParams """ @@ -171,7 +168,6 @@ def get_path(self): class TreeNode: - """ Class for bounding nodes into tree-structure. """ diff --git a/avocado/core/varianter.py b/avocado/core/varianter.py index f70c56582e..f450c9b1bc 100644 --- a/avocado/core/varianter.py +++ b/avocado/core/varianter.py @@ -159,7 +159,6 @@ def dump_ivariants(ivariants): class FakeVariantDispatcher: - """ This object can act instead of VarianterDispatcher to report loaded variants. @@ -210,7 +209,6 @@ def __len__(self): class Varianter: - """ This object takes care of producing test variants """ diff --git a/avocado/plugins/beaker_result.py b/avocado/plugins/beaker_result.py index e3bf9bde78..9c0ecc18ea 100644 --- a/avocado/plugins/beaker_result.py +++ b/avocado/plugins/beaker_result.py @@ -8,6 +8,7 @@ environment variable. Does nothing in case the variable is not set. """ + import glob import os import pprint @@ -20,7 +21,6 @@ class BeakerResult(ResultEvents): - """ send test results to beaker test harness api """ diff --git a/avocado/plugins/cache.py b/avocado/plugins/cache.py index 10212a7e1d..387ac3a7dd 100644 --- a/avocado/plugins/cache.py +++ b/avocado/plugins/cache.py @@ -19,7 +19,6 @@ class Cache(CLICmd): - """ Implements the avocado 'cache' subcommand """ diff --git a/avocado/plugins/config.py b/avocado/plugins/config.py index b253a06b23..ce33825ef9 100644 --- a/avocado/plugins/config.py +++ b/avocado/plugins/config.py @@ -22,7 +22,6 @@ class Config(CLICmd): - """ Implements the avocado 'config' subcommand """ diff --git a/avocado/plugins/dict_variants.py b/avocado/plugins/dict_variants.py index b8c7fcf2d2..3fdf9501b7 100644 --- a/avocado/plugins/dict_variants.py +++ b/avocado/plugins/dict_variants.py @@ -47,7 +47,6 @@ def initialize(self): class DictVariants(Varianter): - """ Turns (a list of) Python dictionaries into variants """ diff --git a/avocado/plugins/diff.py b/avocado/plugins/diff.py index 90733b39b5..794ee72822 100644 --- a/avocado/plugins/diff.py +++ b/avocado/plugins/diff.py @@ -32,7 +32,6 @@ class Diff(CLICmd): - """ Implements the avocado 'diff' subcommand """ diff --git a/avocado/plugins/distro.py b/avocado/plugins/distro.py index 3dbc3f154a..27a669d8d9 100644 --- a/avocado/plugins/distro.py +++ b/avocado/plugins/distro.py @@ -27,7 +27,6 @@ class SoftwarePackage: - """ Definition of relevant information on a software package """ @@ -59,7 +58,6 @@ def to_json(self): class DistroDef(utils_distro.LinuxDistro): - """ More complete information on a given Linux Distribution @@ -104,7 +102,6 @@ def to_json(self): class DistroPkgInfoLoader: - """ Loads information from the distro installation tree into a DistroDef @@ -166,7 +163,6 @@ def get_package_info(self, path): class DistroPkgInfoLoaderRpm(DistroPkgInfoLoader): - """ Loads package information for RPM files """ @@ -196,7 +192,6 @@ def get_package_info(self, path): class DistroPkgInfoLoaderDeb(DistroPkgInfoLoader): - """ Loads package information for DEB files """ @@ -296,7 +291,6 @@ def load_from_tree(name, version, release, arch, package_type, path): class Distro(CLICmd): - """ Implements the avocado 'distro' subcommand """ diff --git a/avocado/plugins/exec_path.py b/avocado/plugins/exec_path.py index 6db0519c1c..c7aa3ffc4c 100644 --- a/avocado/plugins/exec_path.py +++ b/avocado/plugins/exec_path.py @@ -23,7 +23,6 @@ class ExecPath(CLICmd): - """ Implements the avocado 'exec-path' subcommand """ diff --git a/avocado/plugins/human.py b/avocado/plugins/human.py index c0a4f79663..4b4e4e466d 100644 --- a/avocado/plugins/human.py +++ b/avocado/plugins/human.py @@ -46,7 +46,6 @@ def initialize(self): class Human(ResultEvents): - """ Human result UI """ @@ -157,7 +156,6 @@ def post_tests(self, job): class HumanJob(JobPre, JobPost): - """ Human result UI """ diff --git a/avocado/plugins/journal.py b/avocado/plugins/journal.py index a971329b1e..6fbf5151e0 100644 --- a/avocado/plugins/journal.py +++ b/avocado/plugins/journal.py @@ -37,7 +37,6 @@ class JournalResult(ResultEvents): - """ Test Result Journal class. @@ -135,7 +134,6 @@ def post_tests(self, job): class Journal(CLI): - """ Test journal """ diff --git a/avocado/plugins/json_variants.py b/avocado/plugins/json_variants.py index 2cc287b2b0..c6168f732b 100644 --- a/avocado/plugins/json_variants.py +++ b/avocado/plugins/json_variants.py @@ -36,7 +36,6 @@ def initialize(self): class JsonVariantsCLI(CLI): - """ Serialized based Varianter options """ @@ -65,7 +64,6 @@ def run(self, config): class JsonVariants(Varianter): - """ Processes the serialized file into variants """ diff --git a/avocado/plugins/jsonresult.py b/avocado/plugins/jsonresult.py index bfbdfde265..607b55d82b 100644 --- a/avocado/plugins/jsonresult.py +++ b/avocado/plugins/jsonresult.py @@ -133,7 +133,6 @@ def initialize(self): class JSONCLI(CLI): - """ JSON output """ diff --git a/avocado/plugins/list.py b/avocado/plugins/list.py index ac48d56d67..bedefd2656 100644 --- a/avocado/plugins/list.py +++ b/avocado/plugins/list.py @@ -37,7 +37,6 @@ def _get_tags_as_string(tags): class List(CLICmd): - """ Implements the avocado 'list' subcommand """ diff --git a/avocado/plugins/plugins.py b/avocado/plugins/plugins.py index e55dd2fc40..5a4011608d 100644 --- a/avocado/plugins/plugins.py +++ b/avocado/plugins/plugins.py @@ -24,7 +24,6 @@ class Plugins(CLICmd): - """ Plugins information """ diff --git a/avocado/plugins/replay.py b/avocado/plugins/replay.py index 5b6ff7d34b..b7ddef6c08 100644 --- a/avocado/plugins/replay.py +++ b/avocado/plugins/replay.py @@ -25,7 +25,6 @@ class Replay(CLICmd): - """Implements the avocado 'replay' subcommand.""" name = "replay" diff --git a/avocado/plugins/resolvers.py b/avocado/plugins/resolvers.py index 642f409d2b..3020751a22 100644 --- a/avocado/plugins/resolvers.py +++ b/avocado/plugins/resolvers.py @@ -70,7 +70,7 @@ def python_resolver(name, reference, find_tests): class_methods_info, _ = find_tests(module_path) runnables = [] for klass, methods_tags_depens in class_methods_info.items(): - for (method, tags, depens) in methods_tags_depens: + for method, tags, depens in methods_tags_depens: klass_method = f"{klass}.{method}" if tests_filter is not None and not tests_filter.search(klass_method): continue diff --git a/avocado/plugins/run.py b/avocado/plugins/run.py index b014fc8e34..060725f8ee 100644 --- a/avocado/plugins/run.py +++ b/avocado/plugins/run.py @@ -43,7 +43,6 @@ def initialize(self): class Run(CLICmd): - """ Implements the avocado 'run' subcommand """ diff --git a/avocado/plugins/sysinfo.py b/avocado/plugins/sysinfo.py index 14ffde142a..515d7e4469 100644 --- a/avocado/plugins/sysinfo.py +++ b/avocado/plugins/sysinfo.py @@ -264,7 +264,6 @@ def post_test_runnables(self, test_runnable, suite_config=None): class SysInfo(CLICmd): - """ Collect system information """ diff --git a/avocado/plugins/tap.py b/avocado/plugins/tap.py index b62b516042..a87e2b7937 100644 --- a/avocado/plugins/tap.py +++ b/avocado/plugins/tap.py @@ -46,7 +46,6 @@ def writeln(msg, *writeargs): class TAPResult(ResultEvents): - """ TAP output class """ @@ -195,7 +194,6 @@ def initialize(self): class TAP(CLI): - """ TAP Test Anything Protocol output avocado plugin """ diff --git a/avocado/plugins/variants.py b/avocado/plugins/variants.py index 6e423dc0a2..49a42cffa4 100644 --- a/avocado/plugins/variants.py +++ b/avocado/plugins/variants.py @@ -43,7 +43,6 @@ def map_verbosity_level(level): class Variants(CLICmd): - """ Implements "variants" command to visualize/debug test variants and params """ diff --git a/avocado/plugins/xunit.py b/avocado/plugins/xunit.py index e78abc94f6..182ed67c25 100644 --- a/avocado/plugins/xunit.py +++ b/avocado/plugins/xunit.py @@ -231,7 +231,6 @@ def initialize(self): class XUnitCLI(CLI): - """ xUnit output """ diff --git a/avocado/utils/archive.py b/avocado/utils/archive.py index 9bd93a6138..65510c000a 100644 --- a/avocado/utils/archive.py +++ b/avocado/utils/archive.py @@ -162,7 +162,6 @@ class ArchiveException(Exception): class ArchiveFile: - """ Class that represents an Archive file. diff --git a/avocado/utils/cpu.py b/avocado/utils/cpu.py index aec356f397..47c5540d94 100644 --- a/avocado/utils/cpu.py +++ b/avocado/utils/cpu.py @@ -215,7 +215,7 @@ def get_arch(): (b"^hart\\s*: 1$", "riscv"), ] cpuinfo = _get_info() - for (pattern, arch) in cpu_table: + for pattern, arch in cpu_table: if _list_matches(cpuinfo, pattern): if arch == "arm": # ARM is a special situation, which matches both 32 bits diff --git a/avocado/utils/data_structures.py b/avocado/utils/data_structures.py index 0cdced03cd..5b1e803119 100644 --- a/avocado/utils/data_structures.py +++ b/avocado/utils/data_structures.py @@ -199,7 +199,6 @@ def __init__(self): class LazyProperty: - """ Lazily instantiated property. @@ -223,7 +222,6 @@ def __get__(self, obj, cls): class CallbackRegister: - """ Registers pickable functions to be executed later. """ diff --git a/avocado/utils/datadrainer.py b/avocado/utils/datadrainer.py index 913d62aa2e..717bc73beb 100644 --- a/avocado/utils/datadrainer.py +++ b/avocado/utils/datadrainer.py @@ -30,7 +30,6 @@ class BaseDrainer(abc.ABC): - """ Base drainer, doesn't provide complete functionality to be useful. """ diff --git a/avocado/utils/distro.py b/avocado/utils/distro.py index 8897c9e5b9..dcc25942c0 100644 --- a/avocado/utils/distro.py +++ b/avocado/utils/distro.py @@ -38,7 +38,6 @@ # pylint: disable=R0903 class LinuxDistro: - """ Simple collection of information for a Linux Distribution """ @@ -97,7 +96,6 @@ def __repr__(self): class Probe: - """ Probes the machine and does it best to confirm it's the right distro. If given an avocado.utils.ssh.Session object representing another machine, Probe @@ -324,7 +322,6 @@ def get_distro(self): class RedHatProbe(Probe): - """ Probe with version checks for Red Hat Enterprise Linux systems """ @@ -338,7 +335,6 @@ class RedHatProbe(Probe): class CentosProbe(RedHatProbe): - """ Probe with version checks for CentOS systems """ @@ -350,7 +346,6 @@ class CentosProbe(RedHatProbe): class CentosStreamProbe(RedHatProbe): - """ Probe with version checks for CentOS Stream systems """ @@ -362,7 +357,6 @@ class CentosStreamProbe(RedHatProbe): class FedoraProbe(RedHatProbe): - """ Probe with version checks for Fedora systems """ @@ -374,7 +368,6 @@ class FedoraProbe(RedHatProbe): class AmazonLinuxProbe(Probe): - """ Probe for Amazon Linux systems """ @@ -388,7 +381,6 @@ class AmazonLinuxProbe(Probe): class DebianProbe(Probe): - """ Simple probe with file checks for Debian systems """ @@ -399,7 +391,6 @@ class DebianProbe(Probe): class UbuntuProbe(Probe): - """ Simple probe for Ubuntu systems in general """ @@ -413,7 +404,6 @@ class UbuntuProbe(Probe): class SUSEProbe(Probe): - """ Simple probe for SUSE systems in general """ @@ -456,7 +446,6 @@ def get_distro(self): class OpenEulerProbe(Probe): - """ Simple probe for openEuler systems in general """ @@ -468,7 +457,6 @@ class OpenEulerProbe(Probe): class UnionTechProbe(Probe): - """ Simple probe for UnionTech systems in general """ @@ -533,7 +521,6 @@ def detect(session=None): class Spec: - """ Describes a distro, usually for setting minimum distro requirements """ diff --git a/avocado/utils/filelock.py b/avocado/utils/filelock.py index b794eafa36..cc75a5f0ad 100644 --- a/avocado/utils/filelock.py +++ b/avocado/utils/filelock.py @@ -32,7 +32,6 @@ class LockFailed(Exception): class FileLock: - """ Creates an exclusive advisory lock for a file. All processes should use and honor the advisory diff --git a/avocado/utils/gdb.py b/avocado/utils/gdb.py index 3e93cda113..ee48ca0f19 100644 --- a/avocado/utils/gdb.py +++ b/avocado/utils/gdb.py @@ -222,7 +222,6 @@ def string_to_hex(text): class CommandResult: - """ A GDB command, its result, and other possible messages """ @@ -257,7 +256,6 @@ def __repr__(self): class GDB: - """ Wraps a GDB subprocess for easier manipulation """ @@ -549,7 +547,6 @@ def exit(self): class GDBServer: - """ Wraps a gdbserver instance """ diff --git a/avocado/utils/git.py b/avocado/utils/git.py index 0f4f16a939..3a79ae833a 100644 --- a/avocado/utils/git.py +++ b/avocado/utils/git.py @@ -27,7 +27,6 @@ class GitRepoHelper: - """ Helps to deal with git repos, mostly fetching content from a repo """ diff --git a/avocado/utils/iso9660.py b/avocado/utils/iso9660.py index c4d9d143d3..ac1974d4f9 100644 --- a/avocado/utils/iso9660.py +++ b/avocado/utils/iso9660.py @@ -129,7 +129,6 @@ def can_mount(): class BaseIso9660: - """ Represents a ISO9660 filesystem @@ -210,7 +209,6 @@ def close(self): class Iso9660IsoInfo(MixInMntDirMount, BaseIso9660): - """ Represents a ISO9660 filesystem @@ -278,7 +276,6 @@ def read(self, path): class Iso9660IsoRead(MixInMntDirMount, BaseIso9660): - """ Represents a ISO9660 filesystem @@ -306,7 +303,6 @@ def close(self): class Iso9660Mount(BaseIso9660): - """ Represents a mounted ISO9660 filesystem. """ @@ -375,7 +371,6 @@ def mnt_dir(self): class ISO9660PyCDLib(MixInMntDirMount, BaseIso9660): - """ Represents a ISO9660 filesystem @@ -499,7 +494,7 @@ def iso9660(path, capabilities=None): ("mount", can_mount, Iso9660Mount, common_capabilities), ] - for (name, check, klass, cap) in implementations: + for name, check, klass, cap in implementations: if capabilities is not None and not set(capabilities).issubset(cap): continue if check(): diff --git a/avocado/utils/kernel.py b/avocado/utils/kernel.py index 97faa795c9..3fce4c14ec 100644 --- a/avocado/utils/kernel.py +++ b/avocado/utils/kernel.py @@ -31,7 +31,6 @@ class KernelBuild: - """ Build the Linux Kernel from official tarballs. """ diff --git a/avocado/utils/network/ports.py b/avocado/utils/network/ports.py index a3e3299d25..71b12f425e 100644 --- a/avocado/utils/network/ports.py +++ b/avocado/utils/network/ports.py @@ -135,7 +135,6 @@ def find_free_ports( class PortTracker(Borg): - """ Tracks ports used in the host machine. """ diff --git a/avocado/utils/output.py b/avocado/utils/output.py index 55d3f17afc..712294164a 100644 --- a/avocado/utils/output.py +++ b/avocado/utils/output.py @@ -45,7 +45,6 @@ def display_data_size(size): class ProgressBar: - """ Displays interactively the progress of a given task diff --git a/avocado/utils/partition.py b/avocado/utils/partition.py index 670ce6f550..5910e06765 100644 --- a/avocado/utils/partition.py +++ b/avocado/utils/partition.py @@ -33,7 +33,6 @@ class PartitionError(Exception): - """ Generic PartitionError """ @@ -75,7 +74,6 @@ def __exit__(self, exc_type, exc_value, exc_traceback): class Partition: - """ Class for handling partitions and filesystems """ diff --git a/avocado/utils/path.py b/avocado/utils/path.py index 0fede99e7d..5c52c66cc5 100644 --- a/avocado/utils/path.py +++ b/avocado/utils/path.py @@ -26,7 +26,6 @@ class CmdNotFoundError(Exception): - """ Indicates that the command was not found in the system after a search. diff --git a/avocado/utils/process.py b/avocado/utils/process.py index b052ad6def..40907e5e81 100644 --- a/avocado/utils/process.py +++ b/avocado/utils/process.py @@ -336,7 +336,6 @@ def binary_from_shell_cmd(cmd): class CmdResult: - """ Command execution result. @@ -529,7 +528,6 @@ def flush(self): class SubProcess: - """ Run a subprocess in the background, collecting stdout/stderr streams. """ diff --git a/avocado/utils/script.py b/avocado/utils/script.py index d3a5e4c05c..53f8f90fd5 100644 --- a/avocado/utils/script.py +++ b/avocado/utils/script.py @@ -40,7 +40,6 @@ class Script: - """ Class that represents a script. """ @@ -106,7 +105,6 @@ def remove(self): class TemporaryScript(Script): - """ Class that represents a temporary script. """ diff --git a/avocado/utils/service.py b/avocado/utils/service.py index 5076bf8817..a4a287b0a7 100644 --- a/avocado/utils/service.py +++ b/avocado/utils/service.py @@ -368,7 +368,6 @@ def _method(service_name): class _ServiceResultParser: # pylint: disable=too-few-public-methods - """ A class that contains staticmethods to parse the result of service command. """ @@ -402,7 +401,6 @@ def default_method(cmd_result): class _ServiceCommandGenerator: # pylint: disable=too-few-public-methods - """ Generate command lists for starting/stopping services. """ @@ -543,7 +541,6 @@ def run(**kwargs): class _GenericServiceManager: # pylint: disable=too-few-public-methods - """ Base class for SysVInitServiceManager and SystemdServiceManager. """ @@ -626,7 +623,6 @@ def run(service="", **kwargs): class _SysVInitServiceManager( _GenericServiceManager ): # pylint: disable=too-few-public-methods - """ Concrete class that implements the SysVInitServiceManager """ @@ -684,7 +680,6 @@ def convert_systemd_target_to_runlevel(target): class _SystemdServiceManager(_GenericServiceManager): - """ Concrete class that implements the SystemdServiceManager """ diff --git a/avocado/utils/software_manager/backends/apt.py b/avocado/utils/software_manager/backends/apt.py index b7652ebb7c..4ba9efff71 100644 --- a/avocado/utils/software_manager/backends/apt.py +++ b/avocado/utils/software_manager/backends/apt.py @@ -11,7 +11,6 @@ class AptBackend(DpkgBackend): - """ Implements the apt backend for software manager. diff --git a/avocado/utils/software_manager/backends/base.py b/avocado/utils/software_manager/backends/base.py index b65ef12f15..32c3319deb 100644 --- a/avocado/utils/software_manager/backends/base.py +++ b/avocado/utils/software_manager/backends/base.py @@ -25,7 +25,6 @@ class BaseBackend: - """ This class implements all common methods among backends. """ diff --git a/avocado/utils/software_manager/backends/dnf.py b/avocado/utils/software_manager/backends/dnf.py index 5f8af43300..6b4adb20a1 100644 --- a/avocado/utils/software_manager/backends/dnf.py +++ b/avocado/utils/software_manager/backends/dnf.py @@ -7,7 +7,6 @@ class DnfBackend(YumBackend): - """ Implements the dnf backend for software manager. diff --git a/avocado/utils/software_manager/backends/dpkg.py b/avocado/utils/software_manager/backends/dpkg.py index d8df2c5525..527fa1a7ac 100644 --- a/avocado/utils/software_manager/backends/dpkg.py +++ b/avocado/utils/software_manager/backends/dpkg.py @@ -13,7 +13,6 @@ class DpkgBackend(BaseBackend): - """ This class implements operations executed with the dpkg package manager. diff --git a/avocado/utils/software_manager/backends/rpm.py b/avocado/utils/software_manager/backends/rpm.py index e9a2504a3b..83b886b687 100644 --- a/avocado/utils/software_manager/backends/rpm.py +++ b/avocado/utils/software_manager/backends/rpm.py @@ -10,7 +10,6 @@ class RpmBackend(BaseBackend): - """ This class implements operations executed with the rpm package manager. diff --git a/avocado/utils/software_manager/backends/yum.py b/avocado/utils/software_manager/backends/yum.py index 4f8d1f4589..4946f43268 100644 --- a/avocado/utils/software_manager/backends/yum.py +++ b/avocado/utils/software_manager/backends/yum.py @@ -22,7 +22,6 @@ class YumBackend(RpmBackend): - """ Implements the yum backend for software manager. diff --git a/avocado/utils/software_manager/backends/zypper.py b/avocado/utils/software_manager/backends/zypper.py index e4b737faa0..7ef594d018 100644 --- a/avocado/utils/software_manager/backends/zypper.py +++ b/avocado/utils/software_manager/backends/zypper.py @@ -9,7 +9,6 @@ class ZypperBackend(RpmBackend): - """ Implements the zypper backend for software manager. diff --git a/avocado/utils/software_manager/inspector.py b/avocado/utils/software_manager/inspector.py index 65218c3565..93c70a40f7 100644 --- a/avocado/utils/software_manager/inspector.py +++ b/avocado/utils/software_manager/inspector.py @@ -37,7 +37,6 @@ class SystemInspector: - """ System inspector class. diff --git a/avocado/utils/software_manager/manager.py b/avocado/utils/software_manager/manager.py index f795fd2e26..884ad65051 100644 --- a/avocado/utils/software_manager/manager.py +++ b/avocado/utils/software_manager/manager.py @@ -5,7 +5,6 @@ class SoftwareManager: - """ Package management abstraction layer. diff --git a/avocado/utils/ssh.py b/avocado/utils/ssh.py index ff33afacc9..81bb5545c2 100644 --- a/avocado/utils/ssh.py +++ b/avocado/utils/ssh.py @@ -11,6 +11,7 @@ if result.exit_status == 0: print(result.stdout_text) """ + import os import shlex import stat diff --git a/avocado/utils/stacktrace.py b/avocado/utils/stacktrace.py index 540563febd..df96d33349 100644 --- a/avocado/utils/stacktrace.py +++ b/avocado/utils/stacktrace.py @@ -1,6 +1,7 @@ """ Traceback standard module plus some additional APIs. """ + import inspect import logging import pickle diff --git a/avocado/utils/sysinfo.py b/avocado/utils/sysinfo.py index 404bf06b59..6803517237 100644 --- a/avocado/utils/sysinfo.py +++ b/avocado/utils/sysinfo.py @@ -32,7 +32,6 @@ class CollectibleException(Exception): class Collectible(ABC): - """ Abstract class for representing sysinfo collectibles. """ @@ -80,7 +79,6 @@ def __hash__(self): class Logfile(Collectible): - """ Collectible system file. @@ -126,7 +124,6 @@ def collect(self): class Command(Collectible): - """ Collectible command. @@ -192,7 +189,6 @@ def collect(self): class Daemon(Command): - """ Collectible daemon. @@ -271,7 +267,6 @@ def collect(self): class JournalctlWatcher(Collectible): - """ Track the content of systemd journal. @@ -327,7 +322,6 @@ def collect(self): class LogWatcher(Collectible): - """ Keep track of the contents of a log file in another compressed file. diff --git a/contrib/containers/ci/selftests/fedora-38.docker b/contrib/containers/ci/selftests/fedora-38.docker index 2072823d75..bb11cbc32b 100644 --- a/contrib/containers/ci/selftests/fedora-38.docker +++ b/contrib/containers/ci/selftests/fedora-38.docker @@ -2,6 +2,6 @@ FROM fedora:38 LABEL description "Fedora image used on integration checks" RUN dnf -y module enable avocado:latest RUN dnf -y install dnf-plugins-core git findutils make which -RUN dnf -y install diffutils python3-isort python3-enchant python3-pylint python3-autopep8 python3-black +RUN dnf -y install diffutils python3-isort python3-enchant python3-pylint python3-autopep8 RUN dnf -y builddep python-avocado RUN dnf -y clean all diff --git a/docs/source/conf.py b/docs/source/conf.py index b1c126a1a4..3f8ec88fde 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -129,7 +129,7 @@ def generate_vmimage_distro(): # clean up all previous rst files. RTD is known to keep them from previous runs process.run(f"find {BASE_API_OUTPUT_DIR} -name '*.rst' -delete") -for (section, params) in API_SECTIONS.items(): +for section, params in API_SECTIONS.items(): output_dir = os.path.join(BASE_API_OUTPUT_DIR, params[2]) exclude_dirs = [os.path.join(API_SOURCE_DIR, d) for d in params[3]] exclude_dirs = " ".join(exclude_dirs) diff --git a/examples/plugins/tests/magic/avocado_magic/resolver.py b/examples/plugins/tests/magic/avocado_magic/resolver.py index 67f4e3d0a3..f02197c4d2 100644 --- a/examples/plugins/tests/magic/avocado_magic/resolver.py +++ b/examples/plugins/tests/magic/avocado_magic/resolver.py @@ -33,7 +33,7 @@ class MagicResolver(Resolver): def resolve(reference): # pylint: disable=W0221 try: key_word, magic_word = reference.split(":", 1) - except (ValueError): + except ValueError: key_word = None magic_word = reference if key_word != "magic": diff --git a/examples/tests/abort.py b/examples/tests/abort.py index 168e53d1ae..c8c4cdfc07 100644 --- a/examples/tests/abort.py +++ b/examples/tests/abort.py @@ -4,7 +4,6 @@ class AbortTest(Test): - """ A test that just calls abort() (and abort). diff --git a/examples/tests/cabort.py b/examples/tests/cabort.py index d0b638abca..a3f740eb63 100644 --- a/examples/tests/cabort.py +++ b/examples/tests/cabort.py @@ -6,7 +6,6 @@ class CAbort(Test): - """ A test that calls C standard lib function abort(). diff --git a/examples/tests/cancel_on_exception.py b/examples/tests/cancel_on_exception.py index c7cd9b204c..5878c56c1d 100644 --- a/examples/tests/cancel_on_exception.py +++ b/examples/tests/cancel_on_exception.py @@ -2,7 +2,6 @@ class CancelOnException(avocado.Test): - """ Test illustrating the usage of the cancel_on decorator. """ diff --git a/examples/tests/cancel_test.py b/examples/tests/cancel_test.py index 6da32cd907..bbaf303895 100644 --- a/examples/tests/cancel_test.py +++ b/examples/tests/cancel_test.py @@ -4,7 +4,6 @@ class CancelTest(Test): - """ Example tests that cancel the current test from inside the test. """ diff --git a/examples/tests/cancelonsetup.py b/examples/tests/cancelonsetup.py index 6fcaf7acce..029050c0c9 100644 --- a/examples/tests/cancelonsetup.py +++ b/examples/tests/cancelonsetup.py @@ -2,7 +2,6 @@ class CancelOnSetupTest(Test): - """ Example test that cancels the current test, on the setUp phase. """ diff --git a/examples/tests/canceltest.py b/examples/tests/canceltest.py index 68e1731425..4c0e9b700a 100644 --- a/examples/tests/canceltest.py +++ b/examples/tests/canceltest.py @@ -2,7 +2,6 @@ class CancelTest(Test): - """ Example test that cancels the current test from inside the test. """ diff --git a/examples/tests/cit_parameters.py b/examples/tests/cit_parameters.py index 07fab8955a..2b36ee38fc 100644 --- a/examples/tests/cit_parameters.py +++ b/examples/tests/cit_parameters.py @@ -2,7 +2,6 @@ class CitParameters(Test): - """ Example test that fetches the parameters set on examples/cit/params.ini diff --git a/examples/tests/datadir.py b/examples/tests/datadir.py index 3645f10753..e7fd6d4a85 100644 --- a/examples/tests/datadir.py +++ b/examples/tests/datadir.py @@ -6,7 +6,6 @@ class DataDirTest(Test): - """ Test that uses resources from the data dir. diff --git a/examples/tests/doublefail.py b/examples/tests/doublefail.py index de9572ab75..576af4debb 100644 --- a/examples/tests/doublefail.py +++ b/examples/tests/doublefail.py @@ -2,7 +2,6 @@ class DoubleFail(Test): - """ Functional test for avocado. Straight up fail the test. diff --git a/examples/tests/errortest.py b/examples/tests/errortest.py index bcb37f173e..6329536fea 100644 --- a/examples/tests/errortest.py +++ b/examples/tests/errortest.py @@ -2,7 +2,6 @@ class ErrorTest(Test): - """ Example test that ends with ERROR. diff --git a/examples/tests/errortest_nasty.py b/examples/tests/errortest_nasty.py index 69c52f52e0..8cd6080d4f 100644 --- a/examples/tests/errortest_nasty.py +++ b/examples/tests/errortest_nasty.py @@ -2,7 +2,6 @@ class NastyException(Exception): - """Please never use something like this!!!""" def __init__(self, msg): # pylint: disable=W0231 @@ -13,7 +12,6 @@ def __str__(self): class FailTest(Test): - """ Very nasty exception test diff --git a/examples/tests/errortest_nasty2.py b/examples/tests/errortest_nasty2.py index 16dc80a2b3..ded84e071b 100644 --- a/examples/tests/errortest_nasty2.py +++ b/examples/tests/errortest_nasty2.py @@ -2,7 +2,6 @@ class NastyException(Exception): - """Please never use something like this!!!""" def __init__(self, msg): # pylint: disable=W0231 @@ -16,7 +15,6 @@ def __unicode__(self): class FailTest(Test): - """ Very nasty exception test diff --git a/examples/tests/errortest_nasty3.py b/examples/tests/errortest_nasty3.py index fc8d9ae0c6..d53bb344a9 100644 --- a/examples/tests/errortest_nasty3.py +++ b/examples/tests/errortest_nasty3.py @@ -2,7 +2,6 @@ class NastyException: - """Please never use something like this!!! (old-style exception)""" def __init__(self, msg): @@ -13,7 +12,6 @@ def __str__(self): class FailTest(Test): - """ This test raises old-style-class exception diff --git a/examples/tests/fail_on_exception.py b/examples/tests/fail_on_exception.py index fe579ecb0c..8bff1804a1 100644 --- a/examples/tests/fail_on_exception.py +++ b/examples/tests/fail_on_exception.py @@ -2,7 +2,6 @@ class FailOnException(avocado.Test): - """ Test illustrating the behavior of the fail_on decorator. diff --git a/examples/tests/failtest.py b/examples/tests/failtest.py index eaa9faeb61..6b689ae9c8 100644 --- a/examples/tests/failtest.py +++ b/examples/tests/failtest.py @@ -2,7 +2,6 @@ class FailTest(Test): - """ Example test for avocado. Straight up fail the test. diff --git a/examples/tests/failtest_ugly.py b/examples/tests/failtest_ugly.py index 4bdd6bbb6d..9d0fa9cede 100644 --- a/examples/tests/failtest_ugly.py +++ b/examples/tests/failtest_ugly.py @@ -1,6 +1,7 @@ """ Please don't get inspired by this ugly code """ + import sys sys.stdout.write("Direct output to stdout\n") diff --git a/examples/tests/failtest_with_warning.py b/examples/tests/failtest_with_warning.py index bedee0f38f..68ad8e6835 100644 --- a/examples/tests/failtest_with_warning.py +++ b/examples/tests/failtest_with_warning.py @@ -2,7 +2,6 @@ class FailTest(Test): - """ Example test for avocado. Straight up fail the test. diff --git a/examples/tests/gdbtest.py b/examples/tests/gdbtest.py index 0c916f292a..ab83640352 100644 --- a/examples/tests/gdbtest.py +++ b/examples/tests/gdbtest.py @@ -5,7 +5,6 @@ class GdbTest(Test): - """ Execute the gdb test diff --git a/examples/tests/gendata.py b/examples/tests/gendata.py index 6c8e80a5e0..36187f8325 100644 --- a/examples/tests/gendata.py +++ b/examples/tests/gendata.py @@ -4,7 +4,6 @@ class GenDataTest(Test): - """ Simple test that generates data to be persisted after the test is run """ diff --git a/examples/tests/linuxbuild.py b/examples/tests/linuxbuild.py index fc1d8ec054..83f01703cc 100644 --- a/examples/tests/linuxbuild.py +++ b/examples/tests/linuxbuild.py @@ -3,7 +3,6 @@ class LinuxBuildTest(Test): - """ Execute the Linux Build test. diff --git a/examples/tests/modify_variable.py b/examples/tests/modify_variable.py index 564488d977..320c6d03cc 100644 --- a/examples/tests/modify_variable.py +++ b/examples/tests/modify_variable.py @@ -6,7 +6,6 @@ class PrintVariableTest(Test): - """ This demonstrates the GDB API 1) it executes C program which prints MY VARIABLE 'A' IS: 0 diff --git a/examples/tests/multiple_tests.py b/examples/tests/multiple_tests.py index aabf441db9..e96fa946f8 100644 --- a/examples/tests/multiple_tests.py +++ b/examples/tests/multiple_tests.py @@ -2,7 +2,6 @@ class MultipleTests(Test): - """ Following the unittest module pattern, every test method starts with a literal 'test' prefix, so that 'test_foo' and 'testFoo' are diff --git a/examples/tests/multiplextest.py b/examples/tests/multiplextest.py index babbe625e6..c17a310c72 100644 --- a/examples/tests/multiplextest.py +++ b/examples/tests/multiplextest.py @@ -2,7 +2,6 @@ class MultiplexTest(Test): - """ Execute a test that uses provided parameters (for multiplexing testing). diff --git a/examples/tests/passtest.py b/examples/tests/passtest.py index c255c2abe8..900c598cd9 100644 --- a/examples/tests/passtest.py +++ b/examples/tests/passtest.py @@ -2,7 +2,6 @@ class PassTest(Test): - """ Example test that passes. diff --git a/examples/tests/passtest_with_dependency.py b/examples/tests/passtest_with_dependency.py index a6e14e72a7..a952ae1a59 100644 --- a/examples/tests/passtest_with_dependency.py +++ b/examples/tests/passtest_with_dependency.py @@ -2,7 +2,6 @@ class PassTest(Test): - """ Example test that passes. diff --git a/examples/tests/phases.py b/examples/tests/phases.py index e90f32b44c..1075d1dedf 100644 --- a/examples/tests/phases.py +++ b/examples/tests/phases.py @@ -2,7 +2,6 @@ class Phases(Test): - """ Example test for checking the reported test phases """ diff --git a/examples/tests/raise.py b/examples/tests/raise.py index 4d092e4a50..97f374211b 100644 --- a/examples/tests/raise.py +++ b/examples/tests/raise.py @@ -6,7 +6,6 @@ class Raise(Test): - """ A test that calls raise() to signals to itself. diff --git a/examples/tests/sleeptenmin.py b/examples/tests/sleeptenmin.py index c0a9817804..397d3e1b66 100644 --- a/examples/tests/sleeptenmin.py +++ b/examples/tests/sleeptenmin.py @@ -5,7 +5,6 @@ class SleepTenMin(Test): - """ Sleeps for 10 minutes diff --git a/examples/tests/sleeptest.py b/examples/tests/sleeptest.py index 6139aaf34e..442e32df62 100644 --- a/examples/tests/sleeptest.py +++ b/examples/tests/sleeptest.py @@ -4,7 +4,6 @@ class SleepTest(Test): - """ This test sleeps for 1s by default diff --git a/examples/tests/sleeptest_async.py b/examples/tests/sleeptest_async.py index 734000e584..4bc5d3e988 100644 --- a/examples/tests/sleeptest_async.py +++ b/examples/tests/sleeptest_async.py @@ -4,7 +4,6 @@ class AsyncSleepTest(Test): - """ This test sleeps for 1s by default diff --git a/examples/tests/timeouttest.py b/examples/tests/timeouttest.py index 3d075149ba..2a5402c552 100644 --- a/examples/tests/timeouttest.py +++ b/examples/tests/timeouttest.py @@ -4,7 +4,6 @@ class TimeoutTest(Test): - """ Functional test for avocado. Throw a TestTimeoutError. diff --git a/examples/tests/uncaught_exception.py b/examples/tests/uncaught_exception.py index 3336607008..a18b951cbf 100644 --- a/examples/tests/uncaught_exception.py +++ b/examples/tests/uncaught_exception.py @@ -2,7 +2,6 @@ class ErrorTest(Test): - """ Example test that raises generic exception diff --git a/examples/tests/warntest.py b/examples/tests/warntest.py index 08904d62e6..c3613435d0 100644 --- a/examples/tests/warntest.py +++ b/examples/tests/warntest.py @@ -2,7 +2,6 @@ class WarnTest(Test): - """ Functional test for avocado. Throw a TestWarn. """ diff --git a/examples/tests/whiteboard.py b/examples/tests/whiteboard.py index 08345bca14..0656dc4ad6 100644 --- a/examples/tests/whiteboard.py +++ b/examples/tests/whiteboard.py @@ -6,7 +6,6 @@ class WhiteBoard(Test): - """ Example of whiteboard usage. """ diff --git a/optional_plugins/html/avocado_result_html/__init__.py b/optional_plugins/html/avocado_result_html/__init__.py index 7d4a512a4f..049902b29d 100644 --- a/optional_plugins/html/avocado_result_html/__init__.py +++ b/optional_plugins/html/avocado_result_html/__init__.py @@ -34,7 +34,6 @@ class ReportModel: - """ Prepares an object that can be passed up to mustache for rendering. """ @@ -189,7 +188,6 @@ def sysinfo_post(self): class HTMLResult(Result): - """ HTML Test Result class. """ @@ -313,7 +311,6 @@ def initialize(self): class HTML(CLI): - """ HTML job report """ diff --git a/optional_plugins/result_upload/avocado_result_upload/result_upload.py b/optional_plugins/result_upload/avocado_result_upload/result_upload.py index 4a8f10ad10..cb83d9b1c9 100644 --- a/optional_plugins/result_upload/avocado_result_upload/result_upload.py +++ b/optional_plugins/result_upload/avocado_result_upload/result_upload.py @@ -23,7 +23,6 @@ class ResultUpload(Result): - """ ResultsUpload output class """ @@ -57,7 +56,6 @@ def render(self, result, job): class ResultUploadCLI(CLI): - """ ResultsUpload output class """ diff --git a/optional_plugins/resultsdb/avocado_resultsdb/resultsdb.py b/optional_plugins/resultsdb/avocado_resultsdb/resultsdb.py index 3a20e9dc96..5261d92330 100644 --- a/optional_plugins/resultsdb/avocado_resultsdb/resultsdb.py +++ b/optional_plugins/resultsdb/avocado_resultsdb/resultsdb.py @@ -27,7 +27,6 @@ class ResultsdbResultEvent(ResultEvents): - """ ResultsDB output class """ @@ -142,7 +141,6 @@ def _status_map(status): class ResultsdbResult(Result): - """ ResultsDB render class """ @@ -159,7 +157,6 @@ def render(self, result, job): class ResultsdbCLI(CLI): - """ Propagate Job results to Resultsdb """ diff --git a/optional_plugins/varianter_cit/avocado_varianter_cit/CombinationRow.py b/optional_plugins/varianter_cit/avocado_varianter_cit/CombinationRow.py index a7779b7800..0c083e66ec 100644 --- a/optional_plugins/varianter_cit/avocado_varianter_cit/CombinationRow.py +++ b/optional_plugins/varianter_cit/avocado_varianter_cit/CombinationRow.py @@ -2,7 +2,6 @@ class CombinationRow: - """ Row object store all combinations between two parameters into dictionary. Keys in dictionary are values of combinations and values in dictionary are diff --git a/optional_plugins/varianter_cit/avocado_varianter_cit/varianter_cit.py b/optional_plugins/varianter_cit/avocado_varianter_cit/varianter_cit.py index 170a795931..6e5d13f8f7 100644 --- a/optional_plugins/varianter_cit/avocado_varianter_cit/varianter_cit.py +++ b/optional_plugins/varianter_cit/avocado_varianter_cit/varianter_cit.py @@ -30,7 +30,6 @@ class VarianterCitCLI(CLI): - """ CIT Varianter options """ @@ -73,7 +72,6 @@ def run(self, config): class VarianterCit(Varianter): - """ Processes the parameters file into variants """ diff --git a/optional_plugins/varianter_cit/tests/solver.py b/optional_plugins/varianter_cit/tests/solver.py index 75caab2e61..a73ed033b1 100644 --- a/optional_plugins/varianter_cit/tests/solver.py +++ b/optional_plugins/varianter_cit/tests/solver.py @@ -4,7 +4,6 @@ class SolverTest(unittest.TestCase): - """ Test for compute_constraints function """ diff --git a/optional_plugins/varianter_pict/avocado_varianter_pict/varianter_pict.py b/optional_plugins/varianter_pict/avocado_varianter_pict/varianter_pict.py index 15fb4a8ca9..95d24c59a7 100644 --- a/optional_plugins/varianter_pict/avocado_varianter_pict/varianter_pict.py +++ b/optional_plugins/varianter_pict/avocado_varianter_pict/varianter_pict.py @@ -26,7 +26,6 @@ class VarianterPictCLI(CLI): - """ Pict based Varianter options """ @@ -121,7 +120,6 @@ def parse_pict_output(output): class VarianterPict(Varianter): - """ Processes the pict file into variants """ diff --git a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py index cec66d393f..81483bb2c9 100644 --- a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py +++ b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/mux.py @@ -35,7 +35,6 @@ class MuxTree: - """ Object representing part of the tree from the root to leaves or another multiplex domain. Recursively it creates multiplexed variants of the full @@ -211,7 +210,6 @@ def __len__(self): class OutputValue: # only container pylint: disable=R0903 - """Ordinary value with some debug info""" def __init__(self, value, node, srcyaml): @@ -227,7 +225,6 @@ def __str__(self): class OutputList(list): # only container pylint: disable=R0903 - """List with some debug info""" def __init__(self, values, nodes, yamls): @@ -250,7 +247,6 @@ def __str__(self): class ValueDict(dict): # only container pylint: disable=R0903 - """Dict which stores the origin of the items""" def __init__(self, srcyaml, node, values): @@ -289,7 +285,6 @@ def items(self): class Control: # Few methods pylint: disable=R0903 - """Container used to identify node vs. control sequence""" def __init__(self, code, value=None): @@ -298,7 +293,6 @@ def __init__(self, code, value=None): class MuxTreeNode(tree.TreeNode): - """ Class for bounding nodes into tree-structure with support for multiplexation diff --git a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/varianter_yaml_to_mux.py b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/varianter_yaml_to_mux.py index cae7b57648..db260ffe3d 100644 --- a/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/varianter_yaml_to_mux.py +++ b/optional_plugins/varianter_yaml_to_mux/avocado_varianter_yaml_to_mux/varianter_yaml_to_mux.py @@ -49,7 +49,6 @@ class ListOfNodeObjects(list): # Few methods pylint: disable=R0903 - """ Used to mark list as list of objects from whose node is going to be created """ @@ -261,7 +260,6 @@ def _mux_loader(loader, node): class _BaseLoader(SafeLoader): - """ YAML loader with additional features related to mux """ @@ -354,7 +352,6 @@ def _merge(data, path): class YamlToMuxInit(Init): - """ YamlToMux initialization plugin """ @@ -408,7 +405,6 @@ def initialize(self): class YamlToMuxCLI(CLI): - """ Defines arguments for YamlToMux plugin """ @@ -478,7 +474,6 @@ def run(self, config): class YamlToMux(mux.MuxPlugin, Varianter): - """ Processes the mux options into varianter plugin """ diff --git a/requirements-dev.txt b/requirements-dev.txt index 2fa73b73cb..3faaada25d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ isort==5.10.1 pyenchant==3.2.2 pylint==2.17.2 autopep8==1.6.0 -black==22.3.0 +black==24.3.0 coverage==5.5 diff --git a/selftests/.data/get_data.py b/selftests/.data/get_data.py index 7a15be8525..aa2b1dc284 100644 --- a/selftests/.data/get_data.py +++ b/selftests/.data/get_data.py @@ -2,7 +2,6 @@ class GetData(Test): - """ Example for get_data() API usage """ diff --git a/selftests/.data/whiteboard.py b/selftests/.data/whiteboard.py index 17a015344b..fbd14a0059 100755 --- a/selftests/.data/whiteboard.py +++ b/selftests/.data/whiteboard.py @@ -6,7 +6,6 @@ class WhiteBoard(Test): - """ Simple test that saves test custom data to the test whiteboard diff --git a/selftests/functional/fetch_asset.py b/selftests/functional/fetch_asset.py index a4ae093155..e4c769bc4e 100644 --- a/selftests/functional/fetch_asset.py +++ b/selftests/functional/fetch_asset.py @@ -2,7 +2,6 @@ Functional tests for fetch_asset core test method """ - import os import tempfile import unittest diff --git a/selftests/functional/lv_utils.py b/selftests/functional/lv_utils.py index 4ea7b12c77..4d9a634631 100644 --- a/selftests/functional/lv_utils.py +++ b/selftests/functional/lv_utils.py @@ -15,7 +15,6 @@ class LVUtilsTest(TestCaseTmpDir): - """ Check the LVM related utilities """ diff --git a/selftests/functional/plugin/assets.py b/selftests/functional/plugin/assets.py index a99bd3bed5..892fc0a86b 100644 --- a/selftests/functional/plugin/assets.py +++ b/selftests/functional/plugin/assets.py @@ -2,7 +2,6 @@ Assets plugin functional tests """ - import os import tempfile import unittest diff --git a/selftests/functional/serial/requirements.py b/selftests/functional/serial/requirements.py index 6285bc6823..1d24e60b0c 100644 --- a/selftests/functional/serial/requirements.py +++ b/selftests/functional/serial/requirements.py @@ -95,7 +95,6 @@ def test_c(self): class BasicTest(TestCaseTmpDir, Test): - """ :avocado: dependency={"type": "package", "name": "podman", "action": "check"} """ diff --git a/selftests/style.sh b/selftests/style.sh index 18ad91b79f..511bccf09a 100755 --- a/selftests/style.sh +++ b/selftests/style.sh @@ -1,4 +1,4 @@ #!/bin/sh -e echo "** Running black..." -black --check --diff --color . +python3 -m black --check --diff --color . diff --git a/selftests/unit/plugin/resolver.py b/selftests/unit/plugin/resolver.py index 4fa4060182..a0094f8ad6 100644 --- a/selftests/unit/plugin/resolver.py +++ b/selftests/unit/plugin/resolver.py @@ -50,7 +50,6 @@ def test(self): class ReferenceResolution(unittest.TestCase): - """ Tests on how to initialize and use :class:`avocado.core.resolver.ReferenceResolution` diff --git a/selftests/unit/safeloader_core.py b/selftests/unit/safeloader_core.py index 26d6bd2933..f725d938b0 100644 --- a/selftests/unit/safeloader_core.py +++ b/selftests/unit/safeloader_core.py @@ -164,7 +164,6 @@ def get_this_file(): class UnlimitedDiff(unittest.TestCase): - """ Serves two purposes: as a base class to test safeloader.find_class_and_methods and, while at it, to set unlimited diff on failure results. diff --git a/selftests/unit/utils/data_structures.py b/selftests/unit/utils/data_structures.py index 5667f76640..e26646c70d 100644 --- a/selftests/unit/utils/data_structures.py +++ b/selftests/unit/utils/data_structures.py @@ -4,7 +4,6 @@ class TestDataStructures(unittest.TestCase): - """ Unit tests for avocado.utils.data_structures """ diff --git a/selftests/unit/utils/iso9660.py b/selftests/unit/utils/iso9660.py index 420db92392..6242fa6e81 100644 --- a/selftests/unit/utils/iso9660.py +++ b/selftests/unit/utils/iso9660.py @@ -1,6 +1,7 @@ """ Verifies the avocado.utils.iso9660 functionality """ + import os import tempfile import unittest.mock @@ -52,7 +53,6 @@ def test_non_existing_capabilities(self): class BaseIso9660: - """ Base class defining setup and tests for shared Iso9660 functionality """ @@ -116,7 +116,6 @@ def tearDown(self): class IsoInfo(BaseIso9660, unittest.TestCase): - """ IsoInfo-based check """ @@ -130,7 +129,6 @@ def setUp(self): class IsoRead(BaseIso9660, unittest.TestCase): - """ IsoRead-based check """ @@ -144,7 +142,6 @@ def setUp(self): class IsoMount(BaseIso9660, unittest.TestCase): - """ Mount-based check """ @@ -160,7 +157,6 @@ def setUp(self): class PyCDLib(BaseIso9660, unittest.TestCase): - """ PyCDLib-based check """ diff --git a/selftests/unit/utils/partition.py b/selftests/unit/utils/partition.py index 627dba3560..4c472ce753 100644 --- a/selftests/unit/utils/partition.py +++ b/selftests/unit/utils/partition.py @@ -24,7 +24,6 @@ def missing_binary(binary): class Base(unittest.TestCase): - """ Common setUp/tearDown for partition tests """ @@ -79,7 +78,6 @@ def test_basic(self): class TestPartitionMkfsMount(Base): - """ Tests that assume a filesystem and mounted partition """ @@ -205,7 +203,6 @@ def test_format_mounted(self): @unittest.skipIf(not os.path.isfile("/etc/mtab"), "macOS does not have /etc/mtab") class TestMtabLock(unittest.TestCase): - """ Unit tests for avocado.utils.partition """ diff --git a/selftests/unit/utils/stacktrace.py b/selftests/unit/utils/stacktrace.py index 33ddff552f..d6043df1ef 100644 --- a/selftests/unit/utils/stacktrace.py +++ b/selftests/unit/utils/stacktrace.py @@ -51,7 +51,6 @@ def __init__(self, *args, **kwargs): class TestUnpickableObject(unittest.TestCase): - """ Basic selftests for `avocado.utils.stacktrace.str_unpickable_object """