From f38a954fd29d487ded51eea3ac4f6cc5ca8f8363 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Sat, 18 Apr 2020 11:54:48 -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: Ie775b99cdb645f072c0a22fa1a1a47448970b103 Signed-off-by: Sean McGinnis --- monasca_common/tests/policy/test_policy.py | 2 +- monasca_common/tests/test_confluent_kafka.py | 2 +- monasca_common/tests/test_kafka.py | 2 +- monasca_common/tests/test_repositories.py | 2 +- monasca_common/tests/test_rest.py | 2 +- test-requirements.txt | 1 - 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/monasca_common/tests/policy/test_policy.py b/monasca_common/tests/policy/test_policy.py index 50981af6..a9ffae14 100644 --- a/monasca_common/tests/policy/test_policy.py +++ b/monasca_common/tests/policy/test_policy.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -import mock import requests_mock +from unittest import mock from oslo_context import context from oslo_policy import policy as os_policy diff --git a/monasca_common/tests/test_confluent_kafka.py b/monasca_common/tests/test_confluent_kafka.py index b23dd539..9668cb3f 100644 --- a/monasca_common/tests/test_confluent_kafka.py +++ b/monasca_common/tests/test_confluent_kafka.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from monasca_common.confluent_kafka import consumer from monasca_common.confluent_kafka import producer diff --git a/monasca_common/tests/test_kafka.py b/monasca_common/tests/test_kafka.py index 73dcad4d..02444842 100644 --- a/monasca_common/tests/test_kafka.py +++ b/monasca_common/tests/test_kafka.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from oslotest import base diff --git a/monasca_common/tests/test_repositories.py b/monasca_common/tests/test_repositories.py index dcf189d8..1fa95426 100644 --- a/monasca_common/tests/test_repositories.py +++ b/monasca_common/tests/test_repositories.py @@ -10,7 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +from unittest import mock from oslotest import base diff --git a/monasca_common/tests/test_rest.py b/monasca_common/tests/test_rest.py index d901f05e..36982520 100644 --- a/monasca_common/tests/test_rest.py +++ b/monasca_common/tests/test_rest.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock from oslotest import base diff --git a/test-requirements.txt b/test-requirements.txt index a74545d1..bcce3dba 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,6 @@ Babel!=2.4.0,>=2.3.4 # BSD coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD httplib2>=0.9.1 # MIT -mock>=2.0.0 # BSD oslo.context>=2.19.2 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0