diff --git a/test/units/cli/test_galaxy.py b/test/units/cli/test_galaxy.py index be9f8a5dad2..39f06f2ac6d 100644 --- a/test/units/cli/test_galaxy.py +++ b/test/units/cli/test_galaxy.py @@ -24,11 +24,9 @@ import shutil import tarfile import tempfile -from mock import patch - from ansible.compat.six import PY3 from ansible.compat.tests import unittest -from mock import patch, call +from ansible.compat.tests.mock import call, patch import ansible from ansible.errors import AnsibleError, AnsibleOptionsError diff --git a/test/units/module_utils/test_database.py b/test/units/module_utils/test_database.py index c8d66402970..bb9cb8b9d90 100644 --- a/test/units/module_utils/test_database.py +++ b/test/units/module_utils/test_database.py @@ -1,5 +1,4 @@ import collections -import mock import os import re @@ -24,6 +23,8 @@ except ImportError: else: excName = str(expected) raise AssertionError("%s not raised" % excName) +from ansible.compat.tests import mock + from ansible.module_utils.database import ( pg_quote_identifier, SQLParseError, diff --git a/test/units/modules/core/test_apt.py b/test/units/modules/core/test_apt.py index a5571db1ca3..49f73be1d62 100644 --- a/test/units/modules/core/test_apt.py +++ b/test/units/modules/core/test_apt.py @@ -1,9 +1,9 @@ import collections -import mock import os import sys -from ansible.compat.tests import unittest +from ansible.compat.tests import mock +from ansible.compat.tests import unittest try: from ansible.modules.core.packaging.os.apt import ( diff --git a/test/units/plugins/connections/test_connection.py b/test/units/plugins/connections/test_connection.py index 0e7f4da0a08..c34fce1d691 100644 --- a/test/units/plugins/connections/test_connection.py +++ b/test/units/plugins/connections/test_connection.py @@ -21,8 +21,7 @@ __metaclass__ = type from io import StringIO -import mock - +from ansible.compat.tests import mock from ansible.compat.tests import unittest from ansible.errors import AnsibleError from ansible.playbook.play_context import PlayContext