diff options
author | Matt Clay <matt@mystile.com> | 2022-05-23 20:04:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 20:04:56 +0200 |
commit | 3a9a23fb1a7e617479d0ae72dadba0f7a739d13a (patch) | |
tree | dc8ab7f0e2eae3631fe16ea596c3a4ba22f44acd /test/units/utils | |
parent | Replace incidental_inventory_aws_ec2 with intentional coverage (#77743) (diff) | |
download | ansible-3a9a23fb1a7e617479d0ae72dadba0f7a739d13a.tar.xz ansible-3a9a23fb1a7e617479d0ae72dadba0f7a739d13a.zip |
Use unittest.mock instead of mock. (#77883)
This can only be done for controller tests.
Diffstat (limited to 'test/units/utils')
-rw-r--r-- | test/units/utils/collection_loader/test_collection_loader.py | 2 | ||||
-rw-r--r-- | test/units/utils/display/test_broken_cowsay.py | 2 | ||||
-rw-r--r-- | test/units/utils/test_display.py | 2 | ||||
-rw-r--r-- | test/units/utils/test_vars.py | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/test/units/utils/collection_loader/test_collection_loader.py b/test/units/utils/collection_loader/test_collection_loader.py index 3ae04cbd10..f7050dcd6d 100644 --- a/test/units/utils/collection_loader/test_collection_loader.py +++ b/test/units/utils/collection_loader/test_collection_loader.py @@ -17,7 +17,7 @@ from ansible.utils.collection_loader._collection_finder import ( _get_collection_name_from_path, _get_collection_role_path, _get_collection_metadata, _iter_modules_impl ) from ansible.utils.collection_loader._collection_config import _EventSource -from mock import MagicMock, NonCallableMagicMock, patch +from unittest.mock import MagicMock, NonCallableMagicMock, patch # fixture to ensure we always clean up the import stuff when we're done diff --git a/test/units/utils/display/test_broken_cowsay.py b/test/units/utils/display/test_broken_cowsay.py index e93065d8e0..d888010ae5 100644 --- a/test/units/utils/display/test_broken_cowsay.py +++ b/test/units/utils/display/test_broken_cowsay.py @@ -8,7 +8,7 @@ __metaclass__ = type from ansible.utils.display import Display -from mock import MagicMock +from unittest.mock import MagicMock def test_display_with_fake_cowsay_binary(capsys, mocker): diff --git a/test/units/utils/test_display.py b/test/units/utils/test_display.py index 8807b81675..4883a5becc 100644 --- a/test/units/utils/test_display.py +++ b/test/units/utils/test_display.py @@ -5,7 +5,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -from mock import MagicMock +from unittest.mock import MagicMock import pytest diff --git a/test/units/utils/test_vars.py b/test/units/utils/test_vars.py index 1df0eab32b..9be33de429 100644 --- a/test/units/utils/test_vars.py +++ b/test/units/utils/test_vars.py @@ -22,7 +22,7 @@ __metaclass__ = type from collections import defaultdict -import mock +from unittest import mock from units.compat import unittest from ansible.errors import AnsibleError |