diff --git a/kmip/tests/unit/core/objects/test_credentials.py b/kmip/tests/unit/core/objects/test_credentials.py index 9ecd2e037..8b1d3a84d 100644 --- a/kmip/tests/unit/core/objects/test_credentials.py +++ b/kmip/tests/unit/core/objects/test_credentials.py @@ -14,7 +14,7 @@ # under the License. import enum -import mock +from unittest import mock import testtools from kmip import enums diff --git a/kmip/tests/unit/core/test_config_helper.py b/kmip/tests/unit/core/test_config_helper.py index 768659991..ceec5718a 100644 --- a/kmip/tests/unit/core/test_config_helper.py +++ b/kmip/tests/unit/core/test_config_helper.py @@ -19,8 +19,7 @@ import ConfigParser as configparser from testtools import TestCase -from mock import MagicMock -from mock import Mock +from unittest.mock import MagicMock, Mock from kmip.core.config_helper import ConfigHelper diff --git a/kmip/tests/unit/pie/test_client.py b/kmip/tests/unit/pie/test_client.py index 565d4f404..ee0a16aad 100644 --- a/kmip/tests/unit/pie/test_client.py +++ b/kmip/tests/unit/pie/test_client.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import six import ssl import testtools diff --git a/kmip/tests/unit/services/server/auth/test_slugs.py b/kmip/tests/unit/services/server/auth/test_slugs.py index 49fa0c99b..d5489d0e2 100644 --- a/kmip/tests/unit/services/server/auth/test_slugs.py +++ b/kmip/tests/unit/services/server/auth/test_slugs.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import requests import testtools diff --git a/kmip/tests/unit/services/server/auth/test_utils.py b/kmip/tests/unit/services/server/auth/test_utils.py index 2f96c2266..950e8550b 100644 --- a/kmip/tests/unit/services/server/auth/test_utils.py +++ b/kmip/tests/unit/services/server/auth/test_utils.py @@ -19,7 +19,7 @@ from cryptography.hazmat.primitives.asymmetric import rsa import datetime -import mock +from unittest import mock import ssl import testtools diff --git a/kmip/tests/unit/services/server/crypto/test_engine.py b/kmip/tests/unit/services/server/crypto/test_engine.py index edb528323..aefed9dd9 100644 --- a/kmip/tests/unit/services/server/crypto/test_engine.py +++ b/kmip/tests/unit/services/server/crypto/test_engine.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -import mock +from unittest import mock import pytest import testtools diff --git a/kmip/tests/unit/services/server/test_config.py b/kmip/tests/unit/services/server/test_config.py index e4b975082..ab213eceb 100644 --- a/kmip/tests/unit/services/server/test_config.py +++ b/kmip/tests/unit/services/server/test_config.py @@ -14,7 +14,7 @@ # under the License. import logging -import mock +from unittest import mock import six from six.moves import configparser diff --git a/kmip/tests/unit/services/server/test_engine.py b/kmip/tests/unit/services/server/test_engine.py index 84deb436c..8a32a88f4 100644 --- a/kmip/tests/unit/services/server/test_engine.py +++ b/kmip/tests/unit/services/server/test_engine.py @@ -14,7 +14,7 @@ # under the License. import six -import mock +from unittest import mock import shutil import sqlalchemy diff --git a/kmip/tests/unit/services/server/test_monitor.py b/kmip/tests/unit/services/server/test_monitor.py index 7f4c4357c..997055add 100644 --- a/kmip/tests/unit/services/server/test_monitor.py +++ b/kmip/tests/unit/services/server/test_monitor.py @@ -14,7 +14,7 @@ # under the License. import logging -import mock +from unittest import mock import multiprocessing import os import shutil diff --git a/kmip/tests/unit/services/server/test_server.py b/kmip/tests/unit/services/server/test_server.py index 66ec8a36c..106556195 100644 --- a/kmip/tests/unit/services/server/test_server.py +++ b/kmip/tests/unit/services/server/test_server.py @@ -14,15 +14,10 @@ # under the License. import logging - -try: - import unittest.mock as mock -except Exception: - import mock - import signal import socket import testtools +import unittest.mock as mock from kmip.core import exceptions from kmip.services import auth diff --git a/kmip/tests/unit/services/server/test_session.py b/kmip/tests/unit/services/server/test_session.py index b6661c5b9..9ccd67d8d 100644 --- a/kmip/tests/unit/services/server/test_session.py +++ b/kmip/tests/unit/services/server/test_session.py @@ -20,7 +20,7 @@ import datetime -import mock +from unittest import mock import socket import testtools import time diff --git a/kmip/tests/unit/services/test_kmip_client.py b/kmip/tests/unit/services/test_kmip_client.py index fa13a2046..7c97ae47d 100644 --- a/kmip/tests/unit/services/test_kmip_client.py +++ b/kmip/tests/unit/services/test_kmip_client.py @@ -66,7 +66,7 @@ from kmip.services.results import QueryResult from kmip.services.results import RekeyKeyPairResult -import mock +from unittest import mock import os import socket import ssl diff --git a/kmip/tests/unit/services/test_kmip_protocol.py b/kmip/tests/unit/services/test_kmip_protocol.py index e84e43a5e..0ba6850e3 100644 --- a/kmip/tests/unit/services/test_kmip_protocol.py +++ b/kmip/tests/unit/services/test_kmip_protocol.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from mock import call, MagicMock +from unittest.mock import call, MagicMock from testtools import TestCase import binascii diff --git a/test-requirements.txt b/test-requirements.txt index 1ab6197d6..c20669c3f 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,6 @@ pytest flake8 testtools fixtures -mock slugs sphinx PyYAML