diff --git a/test/runner/lib/core_ci.py b/test/runner/lib/core_ci.py index 127ee69c88f..7ae79996e56 100644 --- a/test/runner/lib/core_ci.py +++ b/test/runner/lib/core_ci.py @@ -117,7 +117,7 @@ class AnsibleCoreCI(object): region = 'us-east-1' self.path = "%s-%s" % (self.path, region) - self.endpoints = AWS_ENDPOINTS[region], + self.endpoints = (AWS_ENDPOINTS[region],) self.ssh_key = SshKey(args) if self.platform == 'windows': @@ -192,7 +192,7 @@ class AnsibleCoreCI(object): if self.started: display.info('Skipping started %s/%s instance %s.' % (self.platform, self.version, self.instance_id), verbosity=1) - return + return None if is_shippable(): return self.start_shippable() diff --git a/test/runner/lib/delegation.py b/test/runner/lib/delegation.py index 0932cfcac6d..53407c6dc5a 100644 --- a/test/runner/lib/delegation.py +++ b/test/runner/lib/delegation.py @@ -117,7 +117,7 @@ def delegate_tox(args, exclude, require, integration_targets): :type integration_targets: tuple[IntegrationTarget] """ if args.python: - versions = args.python_version, + versions = (args.python_version,) if args.python_version not in SUPPORTED_PYTHON_VERSIONS: raise ApplicationError('tox does not support Python version %s' % args.python_version) diff --git a/test/runner/lib/sanity/pylint.py b/test/runner/lib/sanity/pylint.py index bd25e42619c..9657ddb33e5 100644 --- a/test/runner/lib/sanity/pylint.py +++ b/test/runner/lib/sanity/pylint.py @@ -99,7 +99,7 @@ class PylintTest(SanitySingleVersion): invalid_ignores.append((line, 'Invalid version: %s' % version)) continue - if version != args.python_version and version != args.python_version.split('.')[0]: + if version not in (args.python_version, args.python_version.split('.')[0]): continue # ignore version specific entries for other versions ignore[path][code] = line @@ -121,12 +121,26 @@ class PylintTest(SanitySingleVersion): contexts[context_name] = sorted(filtered_paths) available_paths -= filtered_paths - add_context(remaining_paths, 'ansible-test', lambda p: p.startswith('test/runner/')) - add_context(remaining_paths, 'units', lambda p: p.startswith('test/units/')) - add_context(remaining_paths, 'test', lambda p: p.startswith('test/')) - add_context(remaining_paths, 'hacking', lambda p: p.startswith('hacking/')) - add_context(remaining_paths, 'modules', lambda p: p.startswith('lib/ansible/modules/')) - add_context(remaining_paths, 'module_utils', lambda p: p.startswith('lib/ansible/module_utils/')) + def filter_path(path_filter=None): + """ + :type path_filter: str + :rtype: (str) -> bool + """ + def context_filter(path_to_filter): + """ + :type path_to_filter: str + :rtype: bool + """ + return path_to_filter.startswith(path_filter) + + return context_filter + + add_context(remaining_paths, 'ansible-test', filter_path('test/runner/')) + add_context(remaining_paths, 'units', filter_path('test/units/')) + add_context(remaining_paths, 'test', filter_path('test/')) + add_context(remaining_paths, 'hacking', filter_path('hacking/')) + add_context(remaining_paths, 'modules', filter_path('lib/ansible/modules/')) + add_context(remaining_paths, 'module_utils', filter_path('lib/ansible/module_utils/')) add_context(remaining_paths, 'ansible', lambda p: True) messages = [] diff --git a/test/runner/lib/target.py b/test/runner/lib/target.py index 6ab356553ec..5713562ce5d 100644 --- a/test/runner/lib/target.py +++ b/test/runner/lib/target.py @@ -446,7 +446,7 @@ class TestTarget(CompletionTarget): if module_path and path.startswith(module_path) and name != '__init__' and ext in MODULE_EXTENSIONS: self.module = name[len(module_prefix or ''):].lstrip('_') - self.modules = self.module, + self.modules = (self.module,) else: self.module = None self.modules = tuple()