summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-06-03 11:25:12 +0000
committerGerrit Code Review <review@openstack.org>2020-06-03 11:25:12 +0000
commited86c75cab78e75216194b06b1dc109b667d5c57 (patch)
tree91aeaebf77e623109608b161930228bcc7fe2313
parent34492ee6089d8970bacfe1b5577a6ef6521e1723 (diff)
parent404fe100a64b26bb1f74312dda61a34c70602ab4 (diff)
downloadtooz-ed86c75cab78e75216194b06b1dc109b667d5c57.tar.gz
Merge "Use unittest.mock instead of third party mock"2.5.0
-rw-r--r--test-requirements.txt1
-rw-r--r--tooz/tests/drivers/test_file.py2
-rw-r--r--tooz/tests/test_coordination.py2
-rw-r--r--tooz/tests/test_etcd.py3
-rw-r--r--tooz/tests/test_hashring.py2
-rw-r--r--tooz/tests/test_memcache.py6
-rw-r--r--tooz/tests/test_postgresql.py6
7 files changed, 7 insertions, 15 deletions
diff --git a/test-requirements.txt b/test-requirements.txt
index 4fd035a..1f3ddde 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,7 +2,6 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-mock>=2.0 # BSD
python-subunit>=0.0.18 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
coverage>=3.6 # Apache-2.0
diff --git a/tooz/tests/drivers/test_file.py b/tooz/tests/drivers/test_file.py
index 149c371..f8c106d 100644
--- a/tooz/tests/drivers/test_file.py
+++ b/tooz/tests/drivers/test_file.py
@@ -16,9 +16,9 @@
# under the License.
import os
+from unittest import mock
import fixtures
-import mock
from testtools import testcase
import tooz
diff --git a/tooz/tests/test_coordination.py b/tooz/tests/test_coordination.py
index d5db96d..1153458 100644
--- a/tooz/tests/test_coordination.py
+++ b/tooz/tests/test_coordination.py
@@ -16,9 +16,9 @@
import threading
import time
+from unittest import mock
from concurrent import futures
-import mock
from six.moves.urllib import parse
from testtools import matchers
from testtools import testcase
diff --git a/tooz/tests/test_etcd.py b/tooz/tests/test_etcd.py
index bbc99e5..fead02a 100644
--- a/tooz/tests/test_etcd.py
+++ b/tooz/tests/test_etcd.py
@@ -14,7 +14,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-import mock
+from unittest import mock
+
from testtools import testcase
import tooz.coordination
diff --git a/tooz/tests/test_hashring.py b/tooz/tests/test_hashring.py
index c1407bd..eeb9edb 100644
--- a/tooz/tests/test_hashring.py
+++ b/tooz/tests/test_hashring.py
@@ -14,8 +14,8 @@
# under the License.
import hashlib
+from unittest import mock
-import mock
from testtools import matchers
from testtools import testcase
diff --git a/tooz/tests/test_memcache.py b/tooz/tests/test_memcache.py
index 07bb815..d3b6d8a 100644
--- a/tooz/tests/test_memcache.py
+++ b/tooz/tests/test_memcache.py
@@ -16,11 +16,7 @@
# under the License.
import socket
-
-try:
- from unittest import mock
-except ImportError:
- import mock
+from unittest import mock
from testtools import testcase
diff --git a/tooz/tests/test_postgresql.py b/tooz/tests/test_postgresql.py
index 8556d94..8671e54 100644
--- a/tooz/tests/test_postgresql.py
+++ b/tooz/tests/test_postgresql.py
@@ -14,11 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-try:
- # Added in python 3.3+
- from unittest import mock
-except ImportError:
- import mock
+from unittest import mock
from oslo_utils import encodeutils
import testtools