From 3f2b766d10ae1376047f30c6dad752dce73339f5 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Thu, 11 Jul 2019 23:46:20 -0700 Subject: [PATCH] Add future and metaclass boilerplate to test code. Continue to ignore: - test/integration/ - test/legacy/ - test/units/ --- test/runner/ansible-test | 2 ++ test/runner/injector/python.py | 2 ++ test/runner/lib/__init__.py | 2 ++ test/runner/lib/ansible_util.py | 4 ++-- test/runner/lib/cache.py | 4 ++-- test/runner/lib/changes.py | 4 ++-- test/runner/lib/classification.py | 4 ++-- test/runner/lib/cli.py | 4 ++-- test/runner/lib/cloud/__init__.py | 3 ++- test/runner/lib/cloud/acme.py | 3 ++- test/runner/lib/cloud/aws.py | 3 ++- test/runner/lib/cloud/azure.py | 3 ++- test/runner/lib/cloud/cloudscale.py | 3 ++- test/runner/lib/cloud/cs.py | 3 ++- test/runner/lib/cloud/foreman.py | 4 ++-- test/runner/lib/cloud/gcp.py | 3 ++- test/runner/lib/cloud/hcloud.py | 3 ++- test/runner/lib/cloud/nios.py | 4 ++-- test/runner/lib/cloud/opennebula.py | 2 ++ test/runner/lib/cloud/openshift.py | 3 ++- test/runner/lib/cloud/scaleway.py | 3 ++- test/runner/lib/cloud/tower.py | 3 ++- test/runner/lib/cloud/vcenter.py | 3 ++- test/runner/lib/cloud/vultr.py | 3 ++- test/runner/lib/config.py | 4 ++-- test/runner/lib/constants.py | 2 ++ test/runner/lib/core_ci.py | 4 ++-- test/runner/lib/cover.py | 4 ++-- test/runner/lib/csharp_import_analysis.py | 4 ++-- test/runner/lib/delegation.py | 4 ++-- test/runner/lib/diff.py | 3 ++- test/runner/lib/docker_util.py | 4 ++-- test/runner/lib/env.py | 4 ++-- test/runner/lib/executor.py | 4 ++-- test/runner/lib/git.py | 4 ++-- test/runner/lib/http.py | 4 ++-- test/runner/lib/import_analysis.py | 4 ++-- test/runner/lib/init.py | 2 ++ test/runner/lib/integration/__init__.py | 4 ++-- test/runner/lib/manage_ci.py | 4 ++-- test/runner/lib/metadata.py | 3 ++- test/runner/lib/powershell_import_analysis.py | 4 ++-- test/runner/lib/pytar.py | 4 ++-- test/runner/lib/sanity/__init__.py | 3 ++- test/runner/lib/sanity/ansible_doc.py | 3 ++- test/runner/lib/sanity/compile.py | 3 ++- test/runner/lib/sanity/import.py | 3 ++- test/runner/lib/sanity/integration_aliases.py | 3 ++- test/runner/lib/sanity/pep8.py | 3 ++- test/runner/lib/sanity/pslint.py | 3 ++- test/runner/lib/sanity/pylint.py | 3 ++- test/runner/lib/sanity/rstcheck.py | 3 ++- test/runner/lib/sanity/sanity_docs.py | 3 ++- test/runner/lib/sanity/shellcheck.py | 3 ++- test/runner/lib/sanity/validate_modules.py | 3 ++- test/runner/lib/sanity/yamllint.py | 3 ++- test/runner/lib/target.py | 4 ++-- test/runner/lib/test.py | 4 ++-- test/runner/lib/thread.py | 4 ++-- test/runner/lib/util.py | 4 ++-- test/runner/lib/util_common.py | 3 ++- test/runner/retry.py | 4 ++-- test/runner/shippable.py | 4 ++-- test/runner/units/test_diff.py | 3 +++ test/runner/versions.py | 2 ++ test/runner/yamlcheck.py | 2 ++ test/sanity/code-smell/action-plugin-docs.py | 2 ++ test/sanity/code-smell/azure-requirements.py | 2 ++ test/sanity/code-smell/botmeta.py | 2 ++ test/sanity/code-smell/changelog.py | 2 ++ test/sanity/code-smell/configure-remoting-ps1.py | 2 ++ test/sanity/code-smell/docs-build.py | 2 ++ test/sanity/code-smell/empty-init.py | 2 ++ test/sanity/code-smell/future-import-boilerplate.py | 6 +++++- test/sanity/code-smell/line-endings.py | 2 ++ test/sanity/code-smell/metaclass-boilerplate.py | 6 +++++- test/sanity/code-smell/no-assert.py | 3 ++- test/sanity/code-smell/no-basestring.py | 2 ++ test/sanity/code-smell/no-dict-iteritems.py | 2 ++ test/sanity/code-smell/no-dict-iterkeys.py | 2 ++ test/sanity/code-smell/no-dict-itervalues.py | 2 ++ test/sanity/code-smell/no-get-exception.py | 2 ++ test/sanity/code-smell/no-illegal-filenames.py | 2 ++ test/sanity/code-smell/no-main-display.py | 3 ++- test/sanity/code-smell/no-smart-quotes.py | 2 ++ test/sanity/code-smell/no-unicode-literals.py | 2 ++ test/sanity/code-smell/no-unwanted-files.py | 3 +++ test/sanity/code-smell/replace-urlopen.py | 2 ++ test/sanity/code-smell/required-and-default-attributes.py | 2 ++ test/sanity/code-smell/shebang.py | 2 ++ test/sanity/code-smell/symlinks.py | 2 ++ test/sanity/code-smell/test-constraints.py | 2 ++ test/sanity/code-smell/use-argspec-type-path.py | 2 ++ test/sanity/code-smell/use-compat-six.py | 2 ++ test/sanity/compile/compile.py | 2 ++ test/sanity/import/importer.py | 4 ++-- test/sanity/validate-modules/__init__.py | 3 ++- test/sanity/validate-modules/main.py | 4 ++-- test/sanity/validate-modules/module_args.py | 2 ++ test/sanity/validate-modules/schema.py | 2 ++ test/sanity/validate-modules/test_validate_modules_regex.py | 2 ++ test/sanity/validate-modules/utils.py | 2 ++ test/sanity/yamllint/yamllinter.py | 4 ++-- test/utils/shippable/timing.py | 2 ++ test/utils/shippable/tools/download.py | 4 ++-- test/utils/shippable/tools/run.py | 4 ++-- 106 files changed, 220 insertions(+), 100 deletions(-) diff --git a/test/runner/ansible-test b/test/runner/ansible-test index 3bc73d62384..74dc229f164 100755 --- a/test/runner/ansible-test +++ b/test/runner/ansible-test @@ -1,6 +1,8 @@ #!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Legacy entry point for ansible-test. The preferred version is in the bin directory.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import lib.cli diff --git a/test/runner/injector/python.py b/test/runner/injector/python.py index b05eee9797b..264a05ea450 100755 --- a/test/runner/injector/python.py +++ b/test/runner/injector/python.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Provides an entry point for python scripts and python modules on the controller with the current python interpreter and optional code coverage collection.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/runner/lib/__init__.py b/test/runner/lib/__init__.py index c29c477f7a4..35f044224c7 100644 --- a/test/runner/lib/__init__.py +++ b/test/runner/lib/__init__.py @@ -1 +1,3 @@ """Support code for Ansible testing infrastructure.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type diff --git a/test/runner/lib/ansible_util.py b/test/runner/lib/ansible_util.py index b089ea4108f..9d568cd0ec6 100644 --- a/test/runner/lib/ansible_util.py +++ b/test/runner/lib/ansible_util.py @@ -1,6 +1,6 @@ """Miscellaneous utility functions and classes specific to ansible cli tools.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/cache.py b/test/runner/lib/cache.py index 20553caf294..45a1fbd3f30 100644 --- a/test/runner/lib/cache.py +++ b/test/runner/lib/cache.py @@ -1,6 +1,6 @@ """Cache for commonly shared data that is intended to be immutable.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type class CommonCache(object): diff --git a/test/runner/lib/changes.py b/test/runner/lib/changes.py index 9a7f6b38dc6..f1717d1e3f9 100644 --- a/test/runner/lib/changes.py +++ b/test/runner/lib/changes.py @@ -1,6 +1,6 @@ """Detect changes in Ansible code.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re import os diff --git a/test/runner/lib/classification.py b/test/runner/lib/classification.py index cc3405be6a3..8ff7d033338 100644 --- a/test/runner/lib/classification.py +++ b/test/runner/lib/classification.py @@ -1,6 +1,6 @@ """Classify changes in Ansible code.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import os diff --git a/test/runner/lib/cli.py b/test/runner/lib/cli.py index 9ce145d3aaf..8e6dbf11f4f 100644 --- a/test/runner/lib/cli.py +++ b/test/runner/lib/cli.py @@ -1,6 +1,6 @@ """Test runner for all Ansible tests.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import errno import os diff --git a/test/runner/lib/cloud/__init__.py b/test/runner/lib/cloud/__init__.py index 8f21c715cec..a7575eaead2 100644 --- a/test/runner/lib/cloud/__init__.py +++ b/test/runner/lib/cloud/__init__.py @@ -1,5 +1,6 @@ """Plugin system for cloud providers and environments for use in integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import abc import atexit diff --git a/test/runner/lib/cloud/acme.py b/test/runner/lib/cloud/acme.py index 0a567a6e9a0..0d200faa27b 100644 --- a/test/runner/lib/cloud/acme.py +++ b/test/runner/lib/cloud/acme.py @@ -1,5 +1,6 @@ """ACME plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import time diff --git a/test/runner/lib/cloud/aws.py b/test/runner/lib/cloud/aws.py index ff7fb9b6881..948415bd90f 100644 --- a/test/runner/lib/cloud/aws.py +++ b/test/runner/lib/cloud/aws.py @@ -1,5 +1,6 @@ """AWS plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/azure.py b/test/runner/lib/cloud/azure.py index efdad61ea21..b1930097e26 100644 --- a/test/runner/lib/cloud/azure.py +++ b/test/runner/lib/cloud/azure.py @@ -1,5 +1,6 @@ """Azure plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/cloudscale.py b/test/runner/lib/cloud/cloudscale.py index 0777a9ce562..60b3c9d3f44 100644 --- a/test/runner/lib/cloud/cloudscale.py +++ b/test/runner/lib/cloud/cloudscale.py @@ -4,7 +4,8 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Cloudscale plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type from os.path import isfile diff --git a/test/runner/lib/cloud/cs.py b/test/runner/lib/cloud/cs.py index d2e9654edfc..5805575c8d6 100644 --- a/test/runner/lib/cloud/cs.py +++ b/test/runner/lib/cloud/cs.py @@ -1,5 +1,6 @@ """CloudStack plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/cloud/foreman.py b/test/runner/lib/cloud/foreman.py index 14b99c275a1..b421c4fd07c 100644 --- a/test/runner/lib/cloud/foreman.py +++ b/test/runner/lib/cloud/foreman.py @@ -1,6 +1,6 @@ """Foreman plugin for integration tests.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/gcp.py b/test/runner/lib/cloud/gcp.py index 7336a6a0f68..9b56e54e227 100644 --- a/test/runner/lib/cloud/gcp.py +++ b/test/runner/lib/cloud/gcp.py @@ -1,7 +1,8 @@ # Copyright: (c) 2018, Google Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """GCP plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/hcloud.py b/test/runner/lib/cloud/hcloud.py index dba35f9e56c..d523eb10658 100644 --- a/test/runner/lib/cloud/hcloud.py +++ b/test/runner/lib/cloud/hcloud.py @@ -1,5 +1,6 @@ """Hetzner Cloud plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/nios.py b/test/runner/lib/cloud/nios.py index 7d586312239..91456ae501e 100644 --- a/test/runner/lib/cloud/nios.py +++ b/test/runner/lib/cloud/nios.py @@ -1,6 +1,6 @@ """NIOS plugin for integration tests.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/opennebula.py b/test/runner/lib/cloud/opennebula.py index 9cc87d3be18..812d19c3092 100644 --- a/test/runner/lib/cloud/opennebula.py +++ b/test/runner/lib/cloud/opennebula.py @@ -1,4 +1,6 @@ """OpenNebula plugin for integration tests.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type from lib.cloud import ( CloudProvider, diff --git a/test/runner/lib/cloud/openshift.py b/test/runner/lib/cloud/openshift.py index 3e294ccde15..eedc764c177 100644 --- a/test/runner/lib/cloud/openshift.py +++ b/test/runner/lib/cloud/openshift.py @@ -1,5 +1,6 @@ """OpenShift plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/cloud/scaleway.py b/test/runner/lib/cloud/scaleway.py index fb9240823d7..3dcba47dfec 100644 --- a/test/runner/lib/cloud/scaleway.py +++ b/test/runner/lib/cloud/scaleway.py @@ -1,5 +1,6 @@ """Scaleway plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/cloud/tower.py b/test/runner/lib/cloud/tower.py index 3e7cd7dc257..8f4ed01f1b9 100644 --- a/test/runner/lib/cloud/tower.py +++ b/test/runner/lib/cloud/tower.py @@ -1,5 +1,6 @@ """Tower plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import time diff --git a/test/runner/lib/cloud/vcenter.py b/test/runner/lib/cloud/vcenter.py index 8b6adb11f9f..1e343718925 100644 --- a/test/runner/lib/cloud/vcenter.py +++ b/test/runner/lib/cloud/vcenter.py @@ -1,5 +1,6 @@ """VMware vCenter plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import time diff --git a/test/runner/lib/cloud/vultr.py b/test/runner/lib/cloud/vultr.py index 79a664f54d4..a47a60431a2 100644 --- a/test/runner/lib/cloud/vultr.py +++ b/test/runner/lib/cloud/vultr.py @@ -1,5 +1,6 @@ """Vultr plugin for integration tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/config.py b/test/runner/lib/config.py index e441d76a81f..85603260fdc 100644 --- a/test/runner/lib/config.py +++ b/test/runner/lib/config.py @@ -1,6 +1,6 @@ """Configuration classes.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/runner/lib/constants.py b/test/runner/lib/constants.py index 10329f4d9c7..f4307822a1a 100644 --- a/test/runner/lib/constants.py +++ b/test/runner/lib/constants.py @@ -1,4 +1,6 @@ """Constants used by ansible-test. Imports should not be used in this file.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type # Setting a low soft RLIMIT_NOFILE value will improve the performance of subprocess.Popen on Python 2.x when close_fds=True. # This will affect all Python subprocesses. It will also affect the current Python process if set before subprocess is imported for the first time. diff --git a/test/runner/lib/core_ci.py b/test/runner/lib/core_ci.py index 27b38b7af77..d7ccecc6b2c 100644 --- a/test/runner/lib/core_ci.py +++ b/test/runner/lib/core_ci.py @@ -1,6 +1,6 @@ """Access Ansible Core CI remote services.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/cover.py b/test/runner/lib/cover.py index e9948ca2ca0..755c9e2bc53 100644 --- a/test/runner/lib/cover.py +++ b/test/runner/lib/cover.py @@ -1,6 +1,6 @@ """Code coverage utilities.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/runner/lib/csharp_import_analysis.py b/test/runner/lib/csharp_import_analysis.py index 38d8eed3f01..396d1640bf5 100644 --- a/test/runner/lib/csharp_import_analysis.py +++ b/test/runner/lib/csharp_import_analysis.py @@ -1,6 +1,6 @@ """Analyze C# import statements.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/runner/lib/delegation.py b/test/runner/lib/delegation.py index 7c1e5cb85aa..99c8671cab7 100644 --- a/test/runner/lib/delegation.py +++ b/test/runner/lib/delegation.py @@ -1,6 +1,6 @@ """Delegate test execution to another environment.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/runner/lib/diff.py b/test/runner/lib/diff.py index 8150a48c48d..f5558461352 100644 --- a/test/runner/lib/diff.py +++ b/test/runner/lib/diff.py @@ -1,5 +1,6 @@ """Diff parsing functions and classes.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re import textwrap diff --git a/test/runner/lib/docker_util.py b/test/runner/lib/docker_util.py index 556486c9b4d..c481bbfba52 100644 --- a/test/runner/lib/docker_util.py +++ b/test/runner/lib/docker_util.py @@ -1,6 +1,6 @@ """Functions for accessing docker via the docker cli.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/env.py b/test/runner/lib/env.py index 3588800ea55..97d6bb225ce 100644 --- a/test/runner/lib/env.py +++ b/test/runner/lib/env.py @@ -1,6 +1,6 @@ """Show information about the test environment.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import datetime import json diff --git a/test/runner/lib/executor.py b/test/runner/lib/executor.py index a6ae03fa55d..5b004e95e00 100644 --- a/test/runner/lib/executor.py +++ b/test/runner/lib/executor.py @@ -1,6 +1,6 @@ """Execute Ansible tests.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/git.py b/test/runner/lib/git.py index 20ac5bc8d11..3333595199f 100644 --- a/test/runner/lib/git.py +++ b/test/runner/lib/git.py @@ -1,6 +1,6 @@ """Wrapper around git command-line tools.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import lib.types as t diff --git a/test/runner/lib/http.py b/test/runner/lib/http.py index c0f2a1ebb7b..e14a5f41040 100644 --- a/test/runner/lib/http.py +++ b/test/runner/lib/http.py @@ -2,8 +2,8 @@ Primitive replacement for requests to avoid extra dependency. Avoids use of urllib2 due to lack of SNI support. """ - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import time diff --git a/test/runner/lib/import_analysis.py b/test/runner/lib/import_analysis.py index 5ecfff8635f..dd511c1e4f9 100644 --- a/test/runner/lib/import_analysis.py +++ b/test/runner/lib/import_analysis.py @@ -1,6 +1,6 @@ """Analyze python import statements.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import ast import os diff --git a/test/runner/lib/init.py b/test/runner/lib/init.py index 7bc39c3ed09..5ce29a7e396 100644 --- a/test/runner/lib/init.py +++ b/test/runner/lib/init.py @@ -1,4 +1,6 @@ """Early initialization for ansible-test before most other imports have been performed.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import resource diff --git a/test/runner/lib/integration/__init__.py b/test/runner/lib/integration/__init__.py index c5a54bba635..8e4fc1edaa9 100644 --- a/test/runner/lib/integration/__init__.py +++ b/test/runner/lib/integration/__init__.py @@ -1,6 +1,6 @@ """Ansible integration test infrastructure.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import contextlib import json diff --git a/test/runner/lib/manage_ci.py b/test/runner/lib/manage_ci.py index 8dce216aa74..5f1525dacaf 100644 --- a/test/runner/lib/manage_ci.py +++ b/test/runner/lib/manage_ci.py @@ -1,6 +1,6 @@ """Access Ansible Core CI remote services.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import tempfile diff --git a/test/runner/lib/metadata.py b/test/runner/lib/metadata.py index a06404de4e4..ac3d979253b 100644 --- a/test/runner/lib/metadata.py +++ b/test/runner/lib/metadata.py @@ -1,5 +1,6 @@ """Test metadata for passing data to delegated tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json diff --git a/test/runner/lib/powershell_import_analysis.py b/test/runner/lib/powershell_import_analysis.py index adbd2065e3b..7eb8d3eee4a 100644 --- a/test/runner/lib/powershell_import_analysis.py +++ b/test/runner/lib/powershell_import_analysis.py @@ -1,6 +1,6 @@ """Analyze powershell import statements.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/runner/lib/pytar.py b/test/runner/lib/pytar.py index db79d49495a..5fcfeb3e51c 100644 --- a/test/runner/lib/pytar.py +++ b/test/runner/lib/pytar.py @@ -1,6 +1,6 @@ """Python native TGZ creation.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import abc import tarfile diff --git a/test/runner/lib/sanity/__init__.py b/test/runner/lib/sanity/__init__.py index 145a10f686d..3f38b1a3c3c 100644 --- a/test/runner/lib/sanity/__init__.py +++ b/test/runner/lib/sanity/__init__.py @@ -1,5 +1,6 @@ """Execute Ansible sanity tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import abc import glob diff --git a/test/runner/lib/sanity/ansible_doc.py b/test/runner/lib/sanity/ansible_doc.py index bc012fd94fa..9ca541741a4 100644 --- a/test/runner/lib/sanity/ansible_doc.py +++ b/test/runner/lib/sanity/ansible_doc.py @@ -1,5 +1,6 @@ """Sanity test for ansible-doc.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import os diff --git a/test/runner/lib/sanity/compile.py b/test/runner/lib/sanity/compile.py index 5f06fd84a94..2d3b8aadae7 100644 --- a/test/runner/lib/sanity/compile.py +++ b/test/runner/lib/sanity/compile.py @@ -1,5 +1,6 @@ """Sanity test for proper python syntax.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/sanity/import.py b/test/runner/lib/sanity/import.py index a1a8527c04c..30ca88261a5 100644 --- a/test/runner/lib/sanity/import.py +++ b/test/runner/lib/sanity/import.py @@ -1,5 +1,6 @@ """Sanity test for proper import exception handling.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/sanity/integration_aliases.py b/test/runner/lib/sanity/integration_aliases.py index 9629f7b3383..7e4611c8e70 100644 --- a/test/runner/lib/sanity/integration_aliases.py +++ b/test/runner/lib/sanity/integration_aliases.py @@ -1,5 +1,6 @@ """Sanity test to check integration test aliases.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import textwrap diff --git a/test/runner/lib/sanity/pep8.py b/test/runner/lib/sanity/pep8.py index d120499e755..3c8a11e9c10 100644 --- a/test/runner/lib/sanity/pep8.py +++ b/test/runner/lib/sanity/pep8.py @@ -1,5 +1,6 @@ """Sanity test for PEP 8 style guidelines using pycodestyle.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/runner/lib/sanity/pslint.py b/test/runner/lib/sanity/pslint.py index b0292e46d43..d9495789280 100644 --- a/test/runner/lib/sanity/pslint.py +++ b/test/runner/lib/sanity/pslint.py @@ -1,5 +1,6 @@ """Sanity test using PSScriptAnalyzer.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import json diff --git a/test/runner/lib/sanity/pylint.py b/test/runner/lib/sanity/pylint.py index 346c64c5f79..d51fb26a76e 100644 --- a/test/runner/lib/sanity/pylint.py +++ b/test/runner/lib/sanity/pylint.py @@ -1,5 +1,6 @@ """Sanity test using pylint.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import itertools diff --git a/test/runner/lib/sanity/rstcheck.py b/test/runner/lib/sanity/rstcheck.py index 30047184781..8b4273d277f 100644 --- a/test/runner/lib/sanity/rstcheck.py +++ b/test/runner/lib/sanity/rstcheck.py @@ -1,5 +1,6 @@ """Sanity test using rstcheck.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/sanity/sanity_docs.py b/test/runner/lib/sanity/sanity_docs.py index 9bb97b93de8..3527fe31978 100644 --- a/test/runner/lib/sanity/sanity_docs.py +++ b/test/runner/lib/sanity/sanity_docs.py @@ -1,5 +1,6 @@ """Sanity test for documentation of sanity tests.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/sanity/shellcheck.py b/test/runner/lib/sanity/shellcheck.py index 8aeaf25a257..59be717c138 100644 --- a/test/runner/lib/sanity/shellcheck.py +++ b/test/runner/lib/sanity/shellcheck.py @@ -1,5 +1,6 @@ """Sanity test using shellcheck.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/runner/lib/sanity/validate_modules.py b/test/runner/lib/sanity/validate_modules.py index 7353b1919d5..d4278af19e5 100644 --- a/test/runner/lib/sanity/validate_modules.py +++ b/test/runner/lib/sanity/validate_modules.py @@ -1,5 +1,6 @@ """Sanity test using validate-modules.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import json diff --git a/test/runner/lib/sanity/yamllint.py b/test/runner/lib/sanity/yamllint.py index b7ee0a5d831..406fef94101 100644 --- a/test/runner/lib/sanity/yamllint.py +++ b/test/runner/lib/sanity/yamllint.py @@ -1,5 +1,6 @@ """Sanity test using yamllint.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json import os diff --git a/test/runner/lib/target.py b/test/runner/lib/target.py index c014fcfb8bc..c5af7e93a21 100644 --- a/test/runner/lib/target.py +++ b/test/runner/lib/target.py @@ -1,6 +1,6 @@ """Test target identification, iteration and inclusion/exclusion.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import collections import os diff --git a/test/runner/lib/test.py b/test/runner/lib/test.py index 235de16aab4..ab00212d3c4 100644 --- a/test/runner/lib/test.py +++ b/test/runner/lib/test.py @@ -1,6 +1,6 @@ """Classes for storing and processing test results.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import datetime import json diff --git a/test/runner/lib/thread.py b/test/runner/lib/thread.py index 8a287790a26..49fbc1baffb 100644 --- a/test/runner/lib/thread.py +++ b/test/runner/lib/thread.py @@ -1,6 +1,6 @@ """Python threading tools.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import threading import sys diff --git a/test/runner/lib/util.py b/test/runner/lib/util.py index 0704bd03f70..0811c4ca4c9 100644 --- a/test/runner/lib/util.py +++ b/test/runner/lib/util.py @@ -1,6 +1,6 @@ """Miscellaneous utility functions and classes.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import contextlib import errno diff --git a/test/runner/lib/util_common.py b/test/runner/lib/util_common.py index 1f5548fb055..d6552bcea3d 100644 --- a/test/runner/lib/util_common.py +++ b/test/runner/lib/util_common.py @@ -1,5 +1,6 @@ """Common utility code that depends on CommonConfig.""" -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import atexit import contextlib diff --git a/test/runner/retry.py b/test/runner/retry.py index 5de8db08ff9..24af14ec9da 100755 --- a/test/runner/retry.py +++ b/test/runner/retry.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Automatically retry failed commands.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type # noinspection PyCompatibility import argparse diff --git a/test/runner/shippable.py b/test/runner/shippable.py index 0b803a7fe9b..3882b62220a 100755 --- a/test/runner/shippable.py +++ b/test/runner/shippable.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK """Verify the current Shippable run has the required number of jobs.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type # noinspection PyCompatibility import argparse diff --git a/test/runner/units/test_diff.py b/test/runner/units/test_diff.py index 22e28fb5a91..4f94ff4d5b3 100644 --- a/test/runner/units/test_diff.py +++ b/test/runner/units/test_diff.py @@ -1,4 +1,7 @@ """Tests for diff module.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import subprocess import pytest diff --git a/test/runner/versions.py b/test/runner/versions.py index e2a5db87675..06729720ed6 100755 --- a/test/runner/versions.py +++ b/test/runner/versions.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Show python and pip versions.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/runner/yamlcheck.py b/test/runner/yamlcheck.py index 9e9ddd451a7..591842f4ad2 100755 --- a/test/runner/yamlcheck.py +++ b/test/runner/yamlcheck.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Show python and pip versions.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import json diff --git a/test/sanity/code-smell/action-plugin-docs.py b/test/sanity/code-smell/action-plugin-docs.py index 76de98ea4d7..11c963e3e71 100755 --- a/test/sanity/code-smell/action-plugin-docs.py +++ b/test/sanity/code-smell/action-plugin-docs.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Test to verify action plugins have an associated module to provide documentation.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/sanity/code-smell/azure-requirements.py b/test/sanity/code-smell/azure-requirements.py index dc3554c698d..1c71b67a70e 100755 --- a/test/sanity/code-smell/azure-requirements.py +++ b/test/sanity/code-smell/azure-requirements.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Make sure the Azure requirements files match.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import filecmp import os diff --git a/test/sanity/code-smell/botmeta.py b/test/sanity/code-smell/botmeta.py index 6de3cb76e8b..cf6edbf614a 100755 --- a/test/sanity/code-smell/botmeta.py +++ b/test/sanity/code-smell/botmeta.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Make sure the data in BOTMETA.yml is valid""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import glob import os diff --git a/test/sanity/code-smell/changelog.py b/test/sanity/code-smell/changelog.py index 86b97ad5c95..31123e5b298 100755 --- a/test/sanity/code-smell/changelog.py +++ b/test/sanity/code-smell/changelog.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/sanity/code-smell/configure-remoting-ps1.py b/test/sanity/code-smell/configure-remoting-ps1.py index 614bf6986a2..7bf26bcf10b 100755 --- a/test/sanity/code-smell/configure-remoting-ps1.py +++ b/test/sanity/code-smell/configure-remoting-ps1.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/sanity/code-smell/docs-build.py b/test/sanity/code-smell/docs-build.py index 29e96020966..4fe99de02eb 100755 --- a/test/sanity/code-smell/docs-build.py +++ b/test/sanity/code-smell/docs-build.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/empty-init.py b/test/sanity/code-smell/empty-init.py index bde356fa968..3839765c39f 100755 --- a/test/sanity/code-smell/empty-init.py +++ b/test/sanity/code-smell/empty-init.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import sys diff --git a/test/sanity/code-smell/future-import-boilerplate.py b/test/sanity/code-smell/future-import-boilerplate.py index 326759946ef..48ce75b661d 100755 --- a/test/sanity/code-smell/future-import-boilerplate.py +++ b/test/sanity/code-smell/future-import-boilerplate.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import sys @@ -20,7 +22,9 @@ def main(): 'contrib/vault/', 'docs/', 'examples/', - 'test/', + 'test/integration/', + 'test/legacy/', + 'test/units/', ) # These files pre-date the boilerplate test and should be fixed up as time goes on diff --git a/test/sanity/code-smell/line-endings.py b/test/sanity/code-smell/line-endings.py index fcbbc5cc494..21a981d3ca9 100755 --- a/test/sanity/code-smell/line-endings.py +++ b/test/sanity/code-smell/line-endings.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import sys diff --git a/test/sanity/code-smell/metaclass-boilerplate.py b/test/sanity/code-smell/metaclass-boilerplate.py index 6d6b086f2c2..858d0b79f61 100755 --- a/test/sanity/code-smell/metaclass-boilerplate.py +++ b/test/sanity/code-smell/metaclass-boilerplate.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import sys @@ -18,7 +20,9 @@ def main(): 'contrib/vault/', 'docs/', 'examples/', - 'test/' + 'test/integration/', + 'test/legacy/', + 'test/units/', ) grandfathered = frozenset(( diff --git a/test/sanity/code-smell/no-assert.py b/test/sanity/code-smell/no-assert.py index 85d8596bced..626dcbc639b 100755 --- a/test/sanity/code-smell/no-assert.py +++ b/test/sanity/code-smell/no-assert.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-basestring.py b/test/sanity/code-smell/no-basestring.py index 3105a097294..6980b1934d0 100755 --- a/test/sanity/code-smell/no-basestring.py +++ b/test/sanity/code-smell/no-basestring.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-dict-iteritems.py b/test/sanity/code-smell/no-dict-iteritems.py index 37a794d4ebd..193e1eac80f 100755 --- a/test/sanity/code-smell/no-dict-iteritems.py +++ b/test/sanity/code-smell/no-dict-iteritems.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-dict-iterkeys.py b/test/sanity/code-smell/no-dict-iterkeys.py index 7383c11209a..65aeeb5b6d5 100755 --- a/test/sanity/code-smell/no-dict-iterkeys.py +++ b/test/sanity/code-smell/no-dict-iterkeys.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-dict-itervalues.py b/test/sanity/code-smell/no-dict-itervalues.py index 8a93dd315ef..c2fd99d1a5e 100755 --- a/test/sanity/code-smell/no-dict-itervalues.py +++ b/test/sanity/code-smell/no-dict-itervalues.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-get-exception.py b/test/sanity/code-smell/no-get-exception.py index 42200053ef2..55b05391c52 100755 --- a/test/sanity/code-smell/no-get-exception.py +++ b/test/sanity/code-smell/no-get-exception.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-illegal-filenames.py b/test/sanity/code-smell/no-illegal-filenames.py index 1a663c5aa7d..bb2a68d5e8f 100755 --- a/test/sanity/code-smell/no-illegal-filenames.py +++ b/test/sanity/code-smell/no-illegal-filenames.py @@ -3,6 +3,8 @@ # a script to check for illegal filenames on various Operating Systems. The # main rules are derived from restrictions on Windows # https://msdn.microsoft.com/en-us/library/aa365247#naming_conventions +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-main-display.py b/test/sanity/code-smell/no-main-display.py index 71fbc63859f..61bf50b7f9e 100755 --- a/test/sanity/code-smell/no-main-display.py +++ b/test/sanity/code-smell/no-main-display.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-smart-quotes.py b/test/sanity/code-smell/no-smart-quotes.py index 7a78d49f006..52dbdd0756e 100755 --- a/test/sanity/code-smell/no-smart-quotes.py +++ b/test/sanity/code-smell/no-smart-quotes.py @@ -1,5 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-unicode-literals.py b/test/sanity/code-smell/no-unicode-literals.py index c80b222a5f6..cc2dee767e8 100755 --- a/test/sanity/code-smell/no-unicode-literals.py +++ b/test/sanity/code-smell/no-unicode-literals.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/no-unwanted-files.py b/test/sanity/code-smell/no-unwanted-files.py index 47cce538353..ff736159588 100755 --- a/test/sanity/code-smell/no-unwanted-files.py +++ b/test/sanity/code-smell/no-unwanted-files.py @@ -1,5 +1,8 @@ #!/usr/bin/env python """Prevent unwanted files from being added to the source tree.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type + import os import sys diff --git a/test/sanity/code-smell/replace-urlopen.py b/test/sanity/code-smell/replace-urlopen.py index 677f9c88a9c..5a92ac014e9 100755 --- a/test/sanity/code-smell/replace-urlopen.py +++ b/test/sanity/code-smell/replace-urlopen.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/required-and-default-attributes.py b/test/sanity/code-smell/required-and-default-attributes.py index 6fa7944da9c..746d358a2d2 100755 --- a/test/sanity/code-smell/required-and-default-attributes.py +++ b/test/sanity/code-smell/required-and-default-attributes.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/code-smell/shebang.py b/test/sanity/code-smell/shebang.py index 9e7d1f136fd..33b63222169 100755 --- a/test/sanity/code-smell/shebang.py +++ b/test/sanity/code-smell/shebang.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import stat diff --git a/test/sanity/code-smell/symlinks.py b/test/sanity/code-smell/symlinks.py index ec5c72635b7..3f54759ba9f 100755 --- a/test/sanity/code-smell/symlinks.py +++ b/test/sanity/code-smell/symlinks.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os diff --git a/test/sanity/code-smell/test-constraints.py b/test/sanity/code-smell/test-constraints.py index d26515de16e..572487ed561 100755 --- a/test/sanity/code-smell/test-constraints.py +++ b/test/sanity/code-smell/test-constraints.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re import sys diff --git a/test/sanity/code-smell/use-argspec-type-path.py b/test/sanity/code-smell/use-argspec-type-path.py index 058f9f9ff5e..be606d14502 100755 --- a/test/sanity/code-smell/use-argspec-type-path.py +++ b/test/sanity/code-smell/use-argspec-type-path.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re import sys diff --git a/test/sanity/code-smell/use-compat-six.py b/test/sanity/code-smell/use-compat-six.py index fc87ed22841..dd5dc594b0d 100755 --- a/test/sanity/code-smell/use-compat-six.py +++ b/test/sanity/code-smell/use-compat-six.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import os import re diff --git a/test/sanity/compile/compile.py b/test/sanity/compile/compile.py index 87d2ee9ddab..cdd08ddaed5 100755 --- a/test/sanity/compile/compile.py +++ b/test/sanity/compile/compile.py @@ -1,5 +1,7 @@ #!/usr/bin/env python """Python syntax checker with lint friendly output.""" +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import parser import sys diff --git a/test/sanity/import/importer.py b/test/sanity/import/importer.py index 62ba53762ad..a5a417010f2 100755 --- a/test/sanity/import/importer.py +++ b/test/sanity/import/importer.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """Import the given python module(s) and report error(s) encountered.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import contextlib import os diff --git a/test/sanity/validate-modules/__init__.py b/test/sanity/validate-modules/__init__.py index 365ff9e927c..d8ff2dc0d4f 100644 --- a/test/sanity/validate-modules/__init__.py +++ b/test/sanity/validate-modules/__init__.py @@ -15,5 +15,6 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type __version__ = '0.0.1b' diff --git a/test/sanity/validate-modules/main.py b/test/sanity/validate-modules/main.py index 72b4d5c9324..db2fb4a2ee9 100755 --- a/test/sanity/validate-modules/main.py +++ b/test/sanity/validate-modules/main.py @@ -16,8 +16,8 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import abc import argparse diff --git a/test/sanity/validate-modules/module_args.py b/test/sanity/validate-modules/module_args.py index 0745c7c3813..50e9416bf8b 100644 --- a/test/sanity/validate-modules/module_args.py +++ b/test/sanity/validate-modules/module_args.py @@ -15,6 +15,8 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import imp import json diff --git a/test/sanity/validate-modules/schema.py b/test/sanity/validate-modules/schema.py index fec13d6f48b..0ca8ffcef9a 100644 --- a/test/sanity/validate-modules/schema.py +++ b/test/sanity/validate-modules/schema.py @@ -3,6 +3,8 @@ # Copyright: (c) 2015, Matt Martz # Copyright: (c) 2015, Rackspace US, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re from voluptuous import ALLOW_EXTRA, PREVENT_EXTRA, All, Any, Length, Invalid, Required, Schema, Self diff --git a/test/sanity/validate-modules/test_validate_modules_regex.py b/test/sanity/validate-modules/test_validate_modules_regex.py index 2227ec1385e..aebe3cd3226 100644 --- a/test/sanity/validate-modules/test_validate_modules_regex.py +++ b/test/sanity/validate-modules/test_validate_modules_regex.py @@ -7,6 +7,8 @@ # 1) cd # 2) source hacking/env-setup # 3) PYTHONPATH=./lib pytest -v sanity/validate-modules +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import re import unittest diff --git a/test/sanity/validate-modules/utils.py b/test/sanity/validate-modules/utils.py index fde2e1597df..82ee711f3d2 100644 --- a/test/sanity/validate-modules/utils.py +++ b/test/sanity/validate-modules/utils.py @@ -15,6 +15,8 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import ast import os diff --git a/test/sanity/yamllint/yamllinter.py b/test/sanity/yamllint/yamllinter.py index 8e61e4fc896..dfdabbac4fc 100755 --- a/test/sanity/yamllint/yamllinter.py +++ b/test/sanity/yamllint/yamllinter.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """Wrapper around yamllint that supports YAML embedded in Ansible modules.""" - -from __future__ import absolute_import, print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import ast import json diff --git a/test/utils/shippable/timing.py b/test/utils/shippable/timing.py index f40e21005ff..fb538271b84 100755 --- a/test/utils/shippable/timing.py +++ b/test/utils/shippable/timing.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3.7 +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type import sys import time diff --git a/test/utils/shippable/tools/download.py b/test/utils/shippable/tools/download.py index f3815d70e07..045028914cb 100755 --- a/test/utils/shippable/tools/download.py +++ b/test/utils/shippable/tools/download.py @@ -18,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . """CLI tool for downloading results from Shippable CI runs.""" - -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type # noinspection PyCompatibility import argparse diff --git a/test/utils/shippable/tools/run.py b/test/utils/shippable/tools/run.py index 1986b9820ed..7ec75903636 100755 --- a/test/utils/shippable/tools/run.py +++ b/test/utils/shippable/tools/run.py @@ -18,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with Ansible. If not, see . """CLI tool for starting new Shippable CI runs.""" - -from __future__ import print_function +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type # noinspection PyCompatibility import argparse