diff --git a/packages/google-cloud-certificate-manager/tests/unit/gapic/certificate_manager_v1/test_certificate_manager.py b/packages/google-cloud-certificate-manager/tests/unit/gapic/certificate_manager_v1/test_certificate_manager.py index 2252c67ddba7..d08a3294a421 100644 --- a/packages/google-cloud-certificate-manager/tests/unit/gapic/certificate_manager_v1/test_certificate_manager.py +++ b/packages/google-cloud-certificate-manager/tests/unit/gapic/certificate_manager_v1/test_certificate_manager.py @@ -13,9 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import math import os +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock + from unittest.mock import AsyncMock +except ImportError: + import mock + +import math + from google.api_core import ( future, gapic_v1, @@ -37,7 +45,6 @@ from google.protobuf import timestamp_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest