diff --git a/tests/asyncio/future/test_async_future.py b/tests/asyncio/future/test_async_future.py index 3322cb05..cd50b6fa 100644 --- a/tests/asyncio/future/test_async_future.py +++ b/tests/asyncio/future/test_async_future.py @@ -14,7 +14,10 @@ import asyncio -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions diff --git a/tests/asyncio/gapic/test_method_async.py b/tests/asyncio/gapic/test_method_async.py index 7318362b..1c12a672 100644 --- a/tests/asyncio/gapic/test_method_async.py +++ b/tests/asyncio/gapic/test_method_async.py @@ -15,7 +15,10 @@ import datetime from grpc.experimental import aio -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import (exceptions, gapic_v1, grpc_helpers_async, diff --git a/tests/asyncio/operations_v1/test_operations_async_client.py b/tests/asyncio/operations_v1/test_operations_async_client.py index a6469016..1b0e3d0e 100644 --- a/tests/asyncio/operations_v1/test_operations_async_client.py +++ b/tests/asyncio/operations_v1/test_operations_async_client.py @@ -13,7 +13,10 @@ # limitations under the License. from grpc.experimental import aio -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import (grpc_helpers_async, operations_v1, diff --git a/tests/asyncio/test_grpc_helpers_async.py b/tests/asyncio/test_grpc_helpers_async.py index 868018cf..312c54b0 100644 --- a/tests/asyncio/test_grpc_helpers_async.py +++ b/tests/asyncio/test_grpc_helpers_async.py @@ -14,7 +14,10 @@ import grpc from grpc.experimental import aio -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions diff --git a/tests/asyncio/test_operation_async.py b/tests/asyncio/test_operation_async.py index e35d1396..9b2294cc 100644 --- a/tests/asyncio/test_operation_async.py +++ b/tests/asyncio/test_operation_async.py @@ -13,7 +13,10 @@ # limitations under the License. -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions diff --git a/tests/asyncio/test_page_iterator_async.py b/tests/asyncio/test_page_iterator_async.py index 4abacc6a..25fb76fb 100644 --- a/tests/asyncio/test_page_iterator_async.py +++ b/tests/asyncio/test_page_iterator_async.py @@ -14,7 +14,10 @@ import inspect -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import page_iterator_async diff --git a/tests/asyncio/test_retry_async.py b/tests/asyncio/test_retry_async.py index 8f863668..1656669e 100644 --- a/tests/asyncio/test_retry_async.py +++ b/tests/asyncio/test_retry_async.py @@ -15,7 +15,10 @@ import datetime import re -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions diff --git a/tests/unit/future/test__helpers.py b/tests/unit/future/test__helpers.py index 98afc599..1d15e66d 100644 --- a/tests/unit/future/test__helpers.py +++ b/tests/unit/future/test__helpers.py @@ -12,7 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import mock +try: + from unittest import mock +except: + import mock from google.api_core.future import _helpers diff --git a/tests/unit/future/test_polling.py b/tests/unit/future/test_polling.py index 2381d036..cc59744e 100644 --- a/tests/unit/future/test_polling.py +++ b/tests/unit/future/test_polling.py @@ -16,7 +16,10 @@ import threading import time -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions, retry diff --git a/tests/unit/gapic/test_method.py b/tests/unit/gapic/test_method.py index 1ae27de0..9ab7b390 100644 --- a/tests/unit/gapic/test_method.py +++ b/tests/unit/gapic/test_method.py @@ -14,7 +14,10 @@ import datetime -import mock +try: + from unittest import mock +except: + import mock from google.api_core import exceptions from google.api_core import retry diff --git a/tests/unit/test_bidi.py b/tests/unit/test_bidi.py index 52215cbd..9f497515 100644 --- a/tests/unit/test_bidi.py +++ b/tests/unit/test_bidi.py @@ -17,7 +17,10 @@ import threading import grpc -import mock +try: + from unittest import mock +except: + import mock import pytest from six.moves import queue diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py index fb29015f..c6d4d802 100644 --- a/tests/unit/test_exceptions.py +++ b/tests/unit/test_exceptions.py @@ -15,7 +15,10 @@ import json import grpc -import mock +try: + from unittest import mock +except: + import mock import requests from six.moves import http_client diff --git a/tests/unit/test_grpc_helpers.py b/tests/unit/test_grpc_helpers.py index 8c6202bc..9bb37567 100644 --- a/tests/unit/test_grpc_helpers.py +++ b/tests/unit/test_grpc_helpers.py @@ -13,7 +13,10 @@ # limitations under the License. import grpc -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import exceptions diff --git a/tests/unit/test_operation.py b/tests/unit/test_operation.py index ae9bafea..d3f0e423 100644 --- a/tests/unit/test_operation.py +++ b/tests/unit/test_operation.py @@ -13,7 +13,10 @@ # limitations under the License. -import mock +try: + from unittest import mock +except: + import mock from google.api_core import exceptions from google.api_core import operation diff --git a/tests/unit/test_page_iterator.py b/tests/unit/test_page_iterator.py index 97b0657b..d78d2502 100644 --- a/tests/unit/test_page_iterator.py +++ b/tests/unit/test_page_iterator.py @@ -15,7 +15,10 @@ import math import types -import mock +try: + from unittest import mock +except: + import mock import pytest import six diff --git a/tests/unit/test_path_template.py b/tests/unit/test_path_template.py index 4c8a7c5e..4dae8982 100644 --- a/tests/unit/test_path_template.py +++ b/tests/unit/test_path_template.py @@ -14,7 +14,10 @@ from __future__ import unicode_literals -import mock +try: + from unittest import mock +except: + import mock import pytest from google.api_core import path_template diff --git a/tests/unit/test_retry.py b/tests/unit/test_retry.py index ce8f417d..758648e0 100644 --- a/tests/unit/test_retry.py +++ b/tests/unit/test_retry.py @@ -16,7 +16,10 @@ import itertools import re -import mock +try: + from unittest import mock +except: + import mock import pytest import requests.exceptions diff --git a/tests/unit/test_timeout.py b/tests/unit/test_timeout.py index 30d624e2..01d0e5b6 100644 --- a/tests/unit/test_timeout.py +++ b/tests/unit/test_timeout.py @@ -15,7 +15,10 @@ import datetime import itertools -import mock +try: + from unittest import mock +except: + import mock from google.api_core import timeout