From f6fb359cf56098297aecebdf75afa85e896278a6 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 18 Apr 2020 11:54:23 -0500 Subject: [PATCH] Use unittest.mock instead of third party mock Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: I97af946c244559513689c1ea9ac2d736d55dbe0f Signed-off-by: Sean McGinnis --- metalsmith/test/test_cmd.py | 2 +- metalsmith/test/test_instance.py | 2 +- metalsmith/test/test_instance_config.py | 2 +- metalsmith/test/test_provisioner.py | 3 ++- metalsmith/test/test_scheduler.py | 3 ++- metalsmith/test/test_sources.py | 3 ++- test-requirements.txt | 1 - 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/metalsmith/test/test_cmd.py b/metalsmith/test/test_cmd.py index 90f2c66..b6e93c1 100644 --- a/metalsmith/test/test_cmd.py +++ b/metalsmith/test/test_cmd.py @@ -16,9 +16,9 @@ import io import json import tempfile +from unittest import mock import fixtures -import mock import testtools from metalsmith import _cmd diff --git a/metalsmith/test/test_instance.py b/metalsmith/test/test_instance.py index 006d6de..a01f626 100644 --- a/metalsmith/test/test_instance.py +++ b/metalsmith/test/test_instance.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from metalsmith import _instance from metalsmith.test import test_provisioner diff --git a/metalsmith/test/test_instance_config.py b/metalsmith/test/test_instance_config.py index 169bffa..28fd00e 100644 --- a/metalsmith/test/test_instance_config.py +++ b/metalsmith/test/test_instance_config.py @@ -14,8 +14,8 @@ # limitations under the License. import json +from unittest import mock -import mock import testtools from metalsmith import instance_config diff --git a/metalsmith/test/test_provisioner.py b/metalsmith/test/test_provisioner.py index 9d8900b..449aea0 100644 --- a/metalsmith/test/test_provisioner.py +++ b/metalsmith/test/test_provisioner.py @@ -13,8 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +from unittest import mock + import fixtures -import mock from openstack import exceptions as os_exc import requests import testtools diff --git a/metalsmith/test/test_scheduler.py b/metalsmith/test/test_scheduler.py index 1e7c20c..bd50080 100644 --- a/metalsmith/test/test_scheduler.py +++ b/metalsmith/test/test_scheduler.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import testtools from metalsmith import _scheduler diff --git a/metalsmith/test/test_sources.py b/metalsmith/test/test_sources.py index 14d3788..640942b 100644 --- a/metalsmith/test/test_sources.py +++ b/metalsmith/test/test_sources.py @@ -13,7 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock + import testtools from metalsmith import exceptions diff --git a/test-requirements.txt b/test-requirements.txt index bc9b6fb..0160b70 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,6 @@ doc8>=0.6.0 # Apache-2.0 flake8-import-order>=0.13 # LGPLv3 fixtures>=3.0.0 # Apache-2.0/BSD hacking>=3.0.0,<3.1.0 # Apache-2.0 -mock>=2.0 # BSD stestr>=1.0.0 # Apache-2.0 testtools>=2.2.0 # MIT Pygments>=2.2.0 # BSD