Skip to content

Commit

Permalink
chore: remove use of old external mock
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Jul 6, 2024
1 parent aff6f55 commit b1ea7fa
Show file tree
Hide file tree
Showing 27 changed files with 26 additions and 35 deletions.
3 changes: 0 additions & 3 deletions google/api_core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
on :mod:`google.api_core`, including both HTTP and gRPC clients.
"""

from __future__ import absolute_import
from __future__ import unicode_literals

import http.client
from typing import Dict
from typing import Union
Expand Down
2 changes: 0 additions & 2 deletions google/api_core/path_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
.. _resource names: https://cloud.google.com/apis/design/resource_names
"""

from __future__ import unicode_literals

from collections import deque
import copy
import functools
Expand Down
2 changes: 0 additions & 2 deletions google/api_core/timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def is_thing_ready(timeout=None):
matches ``api_method(request, timeout=None, retry=None)``.
"""

from __future__ import unicode_literals

import datetime
import functools

Expand Down
3 changes: 0 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import
import os
import pathlib
import re
Expand Down Expand Up @@ -119,7 +118,6 @@ def default(session, install_grpc=True, prerelease=False):

session.install(
"dataclasses",
"mock",
"pytest",
"pytest-cov",
"pytest-xdist",
Expand Down Expand Up @@ -249,7 +247,6 @@ def mypy(session):
"types-setuptools",
"types-requests",
"types-protobuf",
"types-mock",
"types-dataclasses",
)
session.run("mypy", "google", "tests")
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/future/test_async_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import asyncio
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/gapic/test_method_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import datetime
from unittest import mock

import mock
import pytest

try:
Expand Down
3 changes: 2 additions & 1 deletion tests/asyncio/operations_v1/test_operations_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock

import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/retry/test_retry_streaming_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import datetime
import re
import asyncio
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/retry/test_retry_unary_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import datetime
import re
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
3 changes: 2 additions & 1 deletion tests/asyncio/test_grpc_helpers_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock

import pytest # noqa: I202

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/test_operation_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from unittest import mock

import mock
import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/asyncio/test_page_iterator_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import inspect
from unittest import mock

import mock
import pytest

from google.api_core import page_iterator_async
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/future/test__helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock

from google.api_core.future import _helpers

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/future/test_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import concurrent.futures
import threading
import time
from unittest import mock

import mock
import pytest

from google.api_core import exceptions, retry
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/gapic/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import datetime
from unittest import mock

import mock
import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/operations_v1/test_operations_rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# limitations under the License.
#
import os
from unittest import mock

import mock
import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/retry/test_retry_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import itertools
import re
from unittest import mock

import mock
import pytest
import requests.exceptions

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/retry/test_retry_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

import re
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/retry/test_retry_unary.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import datetime
import re
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_bidi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import logging
import queue
import threading
from unittest import mock

import mock
import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import http.client
import json
from unittest import mock

import mock
import pytest
import requests

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_extended_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import dataclasses
import enum
import typing
from unittest import mock

import mock
import pytest

from google.api_core import exceptions
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_grpc_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock

import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from unittest import mock

import mock
import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_page_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

import math
import types
from unittest import mock

import mock
import pytest

from google.api_core import page_iterator
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_path_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import unicode_literals
from unittest import mock

import mock
import pytest

from google.api import auth_pb2
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

import datetime
import itertools

import mock
from unittest import mock

from google.api_core import timeout as timeouts

Expand Down

0 comments on commit b1ea7fa

Please sign in to comment.