diff --git a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py index 821fd87a7df1..a07d69f3881d 100644 --- a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.py +++ b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1/test_certificate_authority_service.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, @@ -39,7 +47,6 @@ from google.type import expr_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest diff --git a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py index c7a7a6def33f..0bd531d94e77 100644 --- a/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py +++ b/packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.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, @@ -39,7 +47,6 @@ from google.protobuf import wrappers_pb2 # type: ignore import grpc from grpc.experimental import aio -import mock from proto.marshal.rules.dates import DurationRule, TimestampRule import pytest