summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/sanity/ignore.txt86
-rw-r--r--test/units/config/manager/test_find_ini_config_file.py2
-rw-r--r--test/units/inventory/test_group.py3
-rw-r--r--test/units/inventory/test_host.py4
-rw-r--r--test/units/mock/path.py3
-rw-r--r--test/units/mock/yaml_helper.py3
-rw-r--r--test/units/module_utils/basic/test__symbolic_mode_to_octal.py2
-rw-r--r--test/units/module_utils/basic/test_deprecate_warn.py3
-rw-r--r--test/units/module_utils/basic/test_exit_json.py2
-rw-r--r--test/units/module_utils/basic/test_get_file_attributes.py2
-rw-r--r--test/units/module_utils/basic/test_heuristic_log_sanitize.py2
-rw-r--r--test/units/module_utils/basic/test_run_command.py2
-rw-r--r--test/units/module_utils/basic/test_safe_eval.py2
-rw-r--r--test/units/module_utils/basic/test_tmpdir.py2
-rw-r--r--test/units/module_utils/common/test_dict_transformations.py3
-rw-r--r--test/units/module_utils/conftest.py3
-rw-r--r--test/units/module_utils/facts/base.py2
-rw-r--r--test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py3
-rw-r--r--test/units/module_utils/facts/network/test_generic_bsd.py2
-rw-r--r--test/units/module_utils/facts/other/test_facter.py2
-rw-r--r--test/units/module_utils/facts/other/test_ohai.py2
-rw-r--r--test/units/module_utils/facts/system/test_lsb.py2
-rw-r--r--test/units/module_utils/facts/test_ansible_collector.py2
-rw-r--r--test/units/module_utils/facts/test_collector.py2
-rw-r--r--test/units/module_utils/facts/test_collectors.py2
-rw-r--r--test/units/module_utils/facts/test_facts.py2
-rw-r--r--test/units/module_utils/facts/test_timeout.py2
-rw-r--r--test/units/module_utils/facts/test_utils.py2
-rw-r--r--test/units/module_utils/json_utils/test_filter_non_json_lines.py2
-rw-r--r--test/units/module_utils/parsing/test_convert_bool.py2
-rw-r--r--test/units/module_utils/test_distro.py3
-rw-r--r--test/units/modules/conftest.py3
-rw-r--r--test/units/modules/test_apt.py3
-rw-r--r--test/units/modules/test_copy.py2
-rw-r--r--test/units/modules/test_iptables.py3
-rw-r--r--test/units/modules/test_known_hosts.py3
-rw-r--r--test/units/modules/test_pip.py3
-rw-r--r--test/units/modules/test_systemd.py2
-rw-r--r--test/units/modules/test_yum.py4
-rw-r--r--test/units/modules/utils.py3
-rw-r--r--test/units/parsing/utils/test_addresses.py3
-rw-r--r--test/units/playbook/test_attribute.py3
-rw-r--r--test/units/playbook/test_conditional.py2
-rw-r--r--test/units/plugins/inventory/test_constructed.py3
-rw-r--r--test/units/plugins/loader_fixtures/import_fixture.py1
-rw-r--r--test/units/plugins/shell/test_cmd.py3
-rw-r--r--test/units/plugins/shell/test_powershell.py3
-rw-r--r--test/units/test_constants.py2
-rw-r--r--test/units/test_context.py2
-rw-r--r--test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py3
-rw-r--r--test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py3
-rw-r--r--test/units/utils/test_cleanup_tmp_file.py2
-rw-r--r--test/units/utils/test_encrypt.py3
-rw-r--r--test/units/utils/test_helpers.py3
-rw-r--r--test/units/utils/test_shlex.py3
55 files changed, 111 insertions, 110 deletions
diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt
index 60590c82f3..ebeeb43763 100644
--- a/test/sanity/ignore.txt
+++ b/test/sanity/ignore.txt
@@ -469,109 +469,27 @@ test/support/windows-integration/plugins/modules/win_regedit.ps1 pslint!skip
test/support/windows-integration/plugins/modules/win_security_policy.ps1 pslint!skip
test/support/windows-integration/plugins/modules/win_shell.ps1 pslint!skip
test/support/windows-integration/plugins/modules/win_wait_for.ps1 pslint!skip
-test/units/config/manager/test_find_ini_config_file.py future-import-boilerplate
test/units/executor/test_play_iterator.py pylint:blacklisted-name
-test/units/inventory/test_group.py future-import-boilerplate
-test/units/inventory/test_group.py metaclass-boilerplate
-test/units/inventory/test_host.py future-import-boilerplate
-test/units/inventory/test_host.py metaclass-boilerplate
-test/units/mock/path.py future-import-boilerplate
-test/units/mock/path.py metaclass-boilerplate
-test/units/mock/yaml_helper.py future-import-boilerplate
-test/units/mock/yaml_helper.py metaclass-boilerplate
-test/units/module_utils/basic/test__symbolic_mode_to_octal.py future-import-boilerplate
-test/units/module_utils/basic/test_deprecate_warn.py future-import-boilerplate
-test/units/module_utils/basic/test_deprecate_warn.py metaclass-boilerplate
test/units/module_utils/basic/test_deprecate_warn.py pylint:ansible-deprecated-no-version
test/units/module_utils/basic/test_deprecate_warn.py pylint:ansible-deprecated-version
-test/units/module_utils/basic/test_exit_json.py future-import-boilerplate
-test/units/module_utils/basic/test_get_file_attributes.py future-import-boilerplate
-test/units/module_utils/basic/test_heuristic_log_sanitize.py future-import-boilerplate
-test/units/module_utils/basic/test_run_command.py future-import-boilerplate
test/units/module_utils/basic/test_run_command.py pylint:blacklisted-name
-test/units/module_utils/basic/test_safe_eval.py future-import-boilerplate
-test/units/module_utils/basic/test_tmpdir.py future-import-boilerplate
-test/units/module_utils/common/test_dict_transformations.py future-import-boilerplate
-test/units/module_utils/common/test_dict_transformations.py metaclass-boilerplate
-test/units/module_utils/conftest.py future-import-boilerplate
-test/units/module_utils/conftest.py metaclass-boilerplate
-test/units/module_utils/facts/base.py future-import-boilerplate
-test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py future-import-boilerplate
-test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py metaclass-boilerplate
-test/units/module_utils/facts/network/test_generic_bsd.py future-import-boilerplate
-test/units/module_utils/facts/other/test_facter.py future-import-boilerplate
-test/units/module_utils/facts/other/test_ohai.py future-import-boilerplate
-test/units/module_utils/facts/system/test_lsb.py future-import-boilerplate
-test/units/module_utils/facts/test_ansible_collector.py future-import-boilerplate
-test/units/module_utils/facts/test_collector.py future-import-boilerplate
-test/units/module_utils/facts/test_collectors.py future-import-boilerplate
-test/units/module_utils/facts/test_facts.py future-import-boilerplate
-test/units/module_utils/facts/test_timeout.py future-import-boilerplate
-test/units/module_utils/facts/test_utils.py future-import-boilerplate
-test/units/module_utils/json_utils/test_filter_non_json_lines.py future-import-boilerplate
-test/units/module_utils/parsing/test_convert_bool.py future-import-boilerplate
-test/units/module_utils/test_distro.py future-import-boilerplate
-test/units/module_utils/test_distro.py metaclass-boilerplate
test/units/module_utils/urls/fixtures/multipart.txt line-endings # Fixture for HTTP tests that use CRLF
test/units/module_utils/urls/test_Request.py replace-urlopen
test/units/module_utils/urls/test_fetch_url.py replace-urlopen
-test/units/modules/conftest.py future-import-boilerplate
-test/units/modules/conftest.py metaclass-boilerplate
-test/units/modules/test_copy.py future-import-boilerplate
-test/units/modules/test_pip.py future-import-boilerplate
-test/units/modules/test_pip.py metaclass-boilerplate
-test/units/modules/test_apt.py future-import-boilerplate
-test/units/modules/test_apt.py metaclass-boilerplate
test/units/modules/test_apt.py pylint:blacklisted-name
-test/units/modules/test_yum.py future-import-boilerplate
-test/units/modules/test_yum.py metaclass-boilerplate
-test/units/modules/test_iptables.py future-import-boilerplate
-test/units/modules/test_iptables.py metaclass-boilerplate
-test/units/modules/test_known_hosts.py future-import-boilerplate
-test/units/modules/test_known_hosts.py metaclass-boilerplate
test/units/modules/test_known_hosts.py pylint:ansible-bad-function
-test/units/modules/test_systemd.py future-import-boilerplate
-test/units/modules/test_systemd.py metaclass-boilerplate
-test/units/modules/utils.py future-import-boilerplate
-test/units/modules/utils.py metaclass-boilerplate
-test/units/parsing/utils/test_addresses.py future-import-boilerplate
-test/units/parsing/utils/test_addresses.py metaclass-boilerplate
test/units/parsing/vault/test_vault.py pylint:blacklisted-name
test/units/playbook/role/test_role.py pylint:blacklisted-name
-test/units/playbook/test_attribute.py future-import-boilerplate
-test/units/playbook/test_attribute.py metaclass-boilerplate
-test/units/playbook/test_conditional.py future-import-boilerplate
-test/units/playbook/test_conditional.py metaclass-boilerplate
-test/units/plugins/inventory/test_constructed.py future-import-boilerplate
-test/units/plugins/inventory/test_constructed.py metaclass-boilerplate
-test/units/plugins/loader_fixtures/import_fixture.py future-import-boilerplate
-test/units/plugins/shell/test_cmd.py future-import-boilerplate
-test/units/plugins/shell/test_cmd.py metaclass-boilerplate
-test/units/plugins/shell/test_powershell.py future-import-boilerplate
-test/units/plugins/shell/test_powershell.py metaclass-boilerplate
test/units/plugins/test_plugins.py pylint:blacklisted-name
test/units/template/test_templar.py pylint:blacklisted-name
-test/units/test_constants.py future-import-boilerplate
-test/units/test_context.py future-import-boilerplate
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py future-import-boilerplate
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py metaclass-boilerplate
+test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_util.py future-import-boilerplate # test expects no boilerplate
+test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_util.py metaclass-boilerplate # test expects no boilerplate
test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py pylint:relative-beyond-top-level
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py future-import-boilerplate
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py metaclass-boilerplate
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_util.py future-import-boilerplate
-test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_util.py metaclass-boilerplate
test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/modules/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/ansible/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/fixtures/collections_masked/ansible_collections/testns/testcoll/__init__.py empty-init # testing that collections don't need inits
test/units/utils/collection_loader/test_collection_loader.py pylint:undefined-variable # magic runtime local var splatting
-test/units/utils/test_cleanup_tmp_file.py future-import-boilerplate
-test/units/utils/test_encrypt.py future-import-boilerplate
-test/units/utils/test_encrypt.py metaclass-boilerplate
-test/units/utils/test_helpers.py future-import-boilerplate
-test/units/utils/test_helpers.py metaclass-boilerplate
-test/units/utils/test_shlex.py future-import-boilerplate
-test/units/utils/test_shlex.py metaclass-boilerplate
test/utils/shippable/check_matrix.py replace-urlopen
test/utils/shippable/timing.py shebang
diff --git a/test/units/config/manager/test_find_ini_config_file.py b/test/units/config/manager/test_find_ini_config_file.py
index 046b89dc5a..df411388be 100644
--- a/test/units/config/manager/test_find_ini_config_file.py
+++ b/test/units/config/manager/test_find_ini_config_file.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
diff --git a/test/units/inventory/test_group.py b/test/units/inventory/test_group.py
index 097445cf6c..e8f1c0b02f 100644
--- a/test/units/inventory/test_group.py
+++ b/test/units/inventory/test_group.py
@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat import unittest
from ansible.inventory.group import Group
diff --git a/test/units/inventory/test_host.py b/test/units/inventory/test_host.py
index ac5ca2bf18..c8f477145e 100644
--- a/test/units/inventory/test_host.py
+++ b/test/units/inventory/test_host.py
@@ -16,6 +16,10 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# for __setstate__/__getstate__ tests
+
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pickle
from units.compat import unittest
diff --git a/test/units/mock/path.py b/test/units/mock/path.py
index 14a35d63ba..721dc2939f 100644
--- a/test/units/mock/path.py
+++ b/test/units/mock/path.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat.mock import MagicMock
from ansible.utils.path import unfrackpath
diff --git a/test/units/mock/yaml_helper.py b/test/units/mock/yaml_helper.py
index cc095fea1a..1ef172159d 100644
--- a/test/units/mock/yaml_helper.py
+++ b/test/units/mock/yaml_helper.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import io
import yaml
diff --git a/test/units/module_utils/basic/test__symbolic_mode_to_octal.py b/test/units/module_utils/basic/test__symbolic_mode_to_octal.py
index cdfc717474..7793b34850 100644
--- a/test/units/module_utils/basic/test__symbolic_mode_to_octal.py
+++ b/test/units/module_utils/basic/test__symbolic_mode_to_octal.py
@@ -5,7 +5,7 @@
# License: GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
diff --git a/test/units/module_utils/basic/test_deprecate_warn.py b/test/units/module_utils/basic/test_deprecate_warn.py
index 38ecc5c4a1..351cf25b19 100644
--- a/test/units/module_utils/basic/test_deprecate_warn.py
+++ b/test/units/module_utils/basic/test_deprecate_warn.py
@@ -3,6 +3,9 @@
# Copyright (c) 2017 Ansible Project
# 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 json
import pytest
diff --git a/test/units/module_utils/basic/test_exit_json.py b/test/units/module_utils/basic/test_exit_json.py
index 94313765a7..240095c0aa 100644
--- a/test/units/module_utils/basic/test_exit_json.py
+++ b/test/units/module_utils/basic/test_exit_json.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
diff --git a/test/units/module_utils/basic/test_get_file_attributes.py b/test/units/module_utils/basic/test_get_file_attributes.py
index e3a167a294..5130a5fbc6 100644
--- a/test/units/module_utils/basic/test_get_file_attributes.py
+++ b/test/units/module_utils/basic/test_get_file_attributes.py
@@ -4,7 +4,7 @@
# License: GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from itertools import product
diff --git a/test/units/module_utils/basic/test_heuristic_log_sanitize.py b/test/units/module_utils/basic/test_heuristic_log_sanitize.py
index 0155307662..f8a0929dc7 100644
--- a/test/units/module_utils/basic/test_heuristic_log_sanitize.py
+++ b/test/units/module_utils/basic/test_heuristic_log_sanitize.py
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
diff --git a/test/units/module_utils/basic/test_run_command.py b/test/units/module_utils/basic/test_run_command.py
index f28f3175f5..3fc9b1f72e 100644
--- a/test/units/module_utils/basic/test_run_command.py
+++ b/test/units/module_utils/basic/test_run_command.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import errno
diff --git a/test/units/module_utils/basic/test_safe_eval.py b/test/units/module_utils/basic/test_safe_eval.py
index a19266eba6..e8538ca911 100644
--- a/test/units/module_utils/basic/test_safe_eval.py
+++ b/test/units/module_utils/basic/test_safe_eval.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from itertools import chain
diff --git a/test/units/module_utils/basic/test_tmpdir.py b/test/units/module_utils/basic/test_tmpdir.py
index 40cd0d161f..818cb9b18f 100644
--- a/test/units/module_utils/basic/test_tmpdir.py
+++ b/test/units/module_utils/basic/test_tmpdir.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
diff --git a/test/units/module_utils/common/test_dict_transformations.py b/test/units/module_utils/common/test_dict_transformations.py
index 6412cc17ff..8d970666af 100644
--- a/test/units/module_utils/common/test_dict_transformations.py
+++ b/test/units/module_utils/common/test_dict_transformations.py
@@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat import unittest
from ansible.module_utils.common.dict_transformations import _camel_to_snake, _snake_to_camel, camel_dict_to_snake_dict, dict_merge
diff --git a/test/units/module_utils/conftest.py b/test/units/module_utils/conftest.py
index 9e4e525746..8bc13c4d55 100644
--- a/test/units/module_utils/conftest.py
+++ b/test/units/module_utils/conftest.py
@@ -1,6 +1,9 @@
# Copyright (c) 2017 Ansible Project
# 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 json
import sys
from io import BytesIO
diff --git a/test/units/module_utils/facts/base.py b/test/units/module_utils/facts/base.py
index 28a2bf8773..33d3087b14 100644
--- a/test/units/module_utils/facts/base.py
+++ b/test/units/module_utils/facts/base.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
diff --git a/test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py b/test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py
index 43ae726761..e14a2da868 100644
--- a/test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py
+++ b/test/units/module_utils/facts/hardware/test_sunos_get_uptime_facts.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import time
from ansible.module_utils.facts.hardware import sunos
diff --git a/test/units/module_utils/facts/network/test_generic_bsd.py b/test/units/module_utils/facts/network/test_generic_bsd.py
index d62a8a4d50..afb698c571 100644
--- a/test/units/module_utils/facts/network/test_generic_bsd.py
+++ b/test/units/module_utils/facts/network/test_generic_bsd.py
@@ -15,7 +15,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import Mock
diff --git a/test/units/module_utils/facts/other/test_facter.py b/test/units/module_utils/facts/other/test_facter.py
index 86e906b58c..7466338eb5 100644
--- a/test/units/module_utils/facts/other/test_facter.py
+++ b/test/units/module_utils/facts/other/test_facter.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import Mock, patch
diff --git a/test/units/module_utils/facts/other/test_ohai.py b/test/units/module_utils/facts/other/test_ohai.py
index 2c15cc5b3b..42a72d9720 100644
--- a/test/units/module_utils/facts/other/test_ohai.py
+++ b/test/units/module_utils/facts/other/test_ohai.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import Mock, patch
diff --git a/test/units/module_utils/facts/system/test_lsb.py b/test/units/module_utils/facts/system/test_lsb.py
index 1a090bf9c3..e2ed2ec0eb 100644
--- a/test/units/module_utils/facts/system/test_lsb.py
+++ b/test/units/module_utils/facts/system/test_lsb.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import Mock, patch
diff --git a/test/units/module_utils/facts/test_ansible_collector.py b/test/units/module_utils/facts/test_ansible_collector.py
index c77ebf6ee6..6c23648666 100644
--- a/test/units/module_utils/facts/test_ansible_collector.py
+++ b/test/units/module_utils/facts/test_ansible_collector.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
# for testing
diff --git a/test/units/module_utils/facts/test_collector.py b/test/units/module_utils/facts/test_collector.py
index a8cf0bc691..9eab89f7aa 100644
--- a/test/units/module_utils/facts/test_collector.py
+++ b/test/units/module_utils/facts/test_collector.py
@@ -17,7 +17,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from collections import defaultdict
diff --git a/test/units/module_utils/facts/test_collectors.py b/test/units/module_utils/facts/test_collectors.py
index 58f62d3926..d9fe79bffa 100644
--- a/test/units/module_utils/facts/test_collectors.py
+++ b/test/units/module_utils/facts/test_collectors.py
@@ -16,7 +16,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import Mock, patch
diff --git a/test/units/module_utils/facts/test_facts.py b/test/units/module_utils/facts/test_facts.py
index ae1678341c..5e2de808f3 100644
--- a/test/units/module_utils/facts/test_facts.py
+++ b/test/units/module_utils/facts/test_facts.py
@@ -17,7 +17,7 @@
#
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
diff --git a/test/units/module_utils/facts/test_timeout.py b/test/units/module_utils/facts/test_timeout.py
index 79eba4ca31..2adbc4a6f3 100644
--- a/test/units/module_utils/facts/test_timeout.py
+++ b/test/units/module_utils/facts/test_timeout.py
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import sys
diff --git a/test/units/module_utils/facts/test_utils.py b/test/units/module_utils/facts/test_utils.py
index 25a9aac7f4..28cb5d3194 100644
--- a/test/units/module_utils/facts/test_utils.py
+++ b/test/units/module_utils/facts/test_utils.py
@@ -14,7 +14,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
diff --git a/test/units/module_utils/json_utils/test_filter_non_json_lines.py b/test/units/module_utils/json_utils/test_filter_non_json_lines.py
index 74c68b0adc..b5b949997e 100644
--- a/test/units/module_utils/json_utils/test_filter_non_json_lines.py
+++ b/test/units/module_utils/json_utils/test_filter_non_json_lines.py
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat import unittest
diff --git a/test/units/module_utils/parsing/test_convert_bool.py b/test/units/module_utils/parsing/test_convert_bool.py
index fc1a973ca3..2c5f8121f5 100644
--- a/test/units/module_utils/parsing/test_convert_bool.py
+++ b/test/units/module_utils/parsing/test_convert_bool.py
@@ -3,7 +3,7 @@
# License: GNU General Public License v3 or later (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt )
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
diff --git a/test/units/module_utils/test_distro.py b/test/units/module_utils/test_distro.py
index e575696e6a..708e7bcacc 100644
--- a/test/units/module_utils/test_distro.py
+++ b/test/units/module_utils/test_distro.py
@@ -12,6 +12,9 @@
# Note that nir0s/distro has many more tests in it's test suite. The tests here are
# primarily for testing the vendoring.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.module_utils import distro
from ansible.module_utils.six import string_types
diff --git a/test/units/modules/conftest.py b/test/units/modules/conftest.py
index 3bbfe0b7a8..a7d1e0475f 100644
--- a/test/units/modules/conftest.py
+++ b/test/units/modules/conftest.py
@@ -1,6 +1,9 @@
# Copyright (c) 2017 Ansible Project
# 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 json
import pytest
diff --git a/test/units/modules/test_apt.py b/test/units/modules/test_apt.py
index 3e4303309f..3daf3c111f 100644
--- a/test/units/modules/test_apt.py
+++ b/test/units/modules/test_apt.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import collections
import sys
diff --git a/test/units/modules/test_copy.py b/test/units/modules/test_copy.py
index 19cff255cc..20c309b60f 100644
--- a/test/units/modules/test_copy.py
+++ b/test/units/modules/test_copy.py
@@ -4,7 +4,7 @@
# License: GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
diff --git a/test/units/modules/test_iptables.py b/test/units/modules/test_iptables.py
index 0dc734b564..68a80d2013 100644
--- a/test/units/modules/test_iptables.py
+++ b/test/units/modules/test_iptables.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat.mock import patch
from ansible.module_utils import basic
from ansible.modules import iptables
diff --git a/test/units/modules/test_known_hosts.py b/test/units/modules/test_known_hosts.py
index 9dbfc5ace8..3b6dfd86e4 100644
--- a/test/units/modules/test_known_hosts.py
+++ b/test/units/modules/test_known_hosts.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import os
import tempfile
from ansible.module_utils import basic
diff --git a/test/units/modules/test_pip.py b/test/units/modules/test_pip.py
index 5de82bb4a4..7f0f8b079a 100644
--- a/test/units/modules/test_pip.py
+++ b/test/units/modules/test_pip.py
@@ -1,5 +1,8 @@
# Copyright (c) 2017 Ansible Project
# 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 json
import pytest
diff --git a/test/units/modules/test_systemd.py b/test/units/modules/test_systemd.py
index 29dc679c04..52c212a0ca 100644
--- a/test/units/modules/test_systemd.py
+++ b/test/units/modules/test_systemd.py
@@ -1,3 +1,5 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from units.compat import unittest
from ansible.modules.systemd import parse_systemctl_show
diff --git a/test/units/modules/test_yum.py b/test/units/modules/test_yum.py
index 38c06d3dc7..e5d601a6dd 100644
--- a/test/units/modules/test_yum.py
+++ b/test/units/modules/test_yum.py
@@ -1,5 +1,7 @@
-
# -*- coding: utf-8 -*-
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat import unittest
from ansible.modules.yum import YumModule
diff --git a/test/units/modules/utils.py b/test/units/modules/utils.py
index a35b6255ab..6d169e36f0 100644
--- a/test/units/modules/utils.py
+++ b/test/units/modules/utils.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import json
from units.compat import unittest
diff --git a/test/units/parsing/utils/test_addresses.py b/test/units/parsing/utils/test_addresses.py
index ea86c55423..4f7304f553 100644
--- a/test/units/parsing/utils/test_addresses.py
+++ b/test/units/parsing/utils/test_addresses.py
@@ -1,5 +1,8 @@
# -*- coding: utf-8 -*-
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import unittest
from ansible.parsing.utils.addresses import parse_address
diff --git a/test/units/playbook/test_attribute.py b/test/units/playbook/test_attribute.py
index c29aa1d1a5..bdb37c11cd 100644
--- a/test/units/playbook/test_attribute.py
+++ b/test/units/playbook/test_attribute.py
@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from units.compat import unittest
from ansible.playbook.attribute import Attribute
diff --git a/test/units/playbook/test_conditional.py b/test/units/playbook/test_conditional.py
index 668a66c747..ce3514846d 100644
--- a/test/units/playbook/test_conditional.py
+++ b/test/units/playbook/test_conditional.py
@@ -1,3 +1,5 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
from units.compat import unittest
from units.mock.loader import DictDataLoader
diff --git a/test/units/plugins/inventory/test_constructed.py b/test/units/plugins/inventory/test_constructed.py
index 4b7fb8afc7..6d521982a0 100644
--- a/test/units/plugins/inventory/test_constructed.py
+++ b/test/units/plugins/inventory/test_constructed.py
@@ -17,6 +17,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
from ansible.errors import AnsibleParserError
diff --git a/test/units/plugins/loader_fixtures/import_fixture.py b/test/units/plugins/loader_fixtures/import_fixture.py
index 95209f65e9..81127332e0 100644
--- a/test/units/plugins/loader_fixtures/import_fixture.py
+++ b/test/units/plugins/loader_fixtures/import_fixture.py
@@ -1,5 +1,6 @@
# Nothing to see here, this file is just empty to support a imp.load_source
# without doing anything
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
diff --git a/test/units/plugins/shell/test_cmd.py b/test/units/plugins/shell/test_cmd.py
index 670b80ab30..4c1a654b73 100644
--- a/test/units/plugins/shell/test_cmd.py
+++ b/test/units/plugins/shell/test_cmd.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import pytest
from ansible.plugins.shell.cmd import ShellModule
diff --git a/test/units/plugins/shell/test_powershell.py b/test/units/plugins/shell/test_powershell.py
index 6da7ffd5e6..2d9997147f 100644
--- a/test/units/plugins/shell/test_powershell.py
+++ b/test/units/plugins/shell/test_powershell.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ansible.plugins.shell.powershell import _parse_clixml, ShellModule
diff --git a/test/units/test_constants.py b/test/units/test_constants.py
index fa9902e775..4cf2f7f9a5 100644
--- a/test/units/test_constants.py
+++ b/test/units/test_constants.py
@@ -17,7 +17,7 @@
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pwd
diff --git a/test/units/test_context.py b/test/units/test_context.py
index 837360452a..24e2376dba 100644
--- a/test/units/test_context.py
+++ b/test/units/test_context.py
@@ -3,7 +3,7 @@
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import context
diff --git a/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py b/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py
index 5b19fa1a50..9d30580f65 100644
--- a/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py
+++ b/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/action/my_action.py
@@ -1,3 +1,6 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from ..module_utils.my_util import question
diff --git a/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py b/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py
index 6b194179aa..35e1381b53 100644
--- a/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py
+++ b/test/units/utils/collection_loader/fixtures/collections/ansible_collections/testns/testcoll/plugins/module_utils/my_other_util.py
@@ -1 +1,4 @@
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
from .my_util import question
diff --git a/test/units/utils/test_cleanup_tmp_file.py b/test/units/utils/test_cleanup_tmp_file.py
index 5bc3900a55..2a44a55b15 100644
--- a/test/units/utils/test_cleanup_tmp_file.py
+++ b/test/units/utils/test_cleanup_tmp_file.py
@@ -2,7 +2,7 @@
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-from __future__ import (absolute_import, division)
+from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
diff --git a/test/units/utils/test_encrypt.py b/test/units/utils/test_encrypt.py
index 91fbf34994..2cbe828a60 100644
--- a/test/units/utils/test_encrypt.py
+++ b/test/units/utils/test_encrypt.py
@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import sys
import pytest
diff --git a/test/units/utils/test_helpers.py b/test/units/utils/test_helpers.py
index be781f058a..ec37b39bd0 100644
--- a/test/units/utils/test_helpers.py
+++ b/test/units/utils/test_helpers.py
@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import unittest
from ansible.utils.helpers import pct_to_int
diff --git a/test/units/utils/test_shlex.py b/test/units/utils/test_shlex.py
index 54a253a3b1..e13d302d0d 100644
--- a/test/units/utils/test_shlex.py
+++ b/test/units/utils/test_shlex.py
@@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+from __future__ import (absolute_import, division, print_function)
+__metaclass__ = type
+
import unittest
from ansible.utils.shlex import shlex_split