Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Switch to unittest.mock from mock#713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsnoxfile.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -124,7 +124,7 @@ def default(session, install_grpc=True, prerelease=False, install_async_rest=Fal

session.install(
"dataclasses",
"mock",
"mock; python_version=='3.7'",
"pytest",
"pytest-cov",
"pytest-xdist",
Expand DownExpand Up@@ -280,8 +280,8 @@ def mypy(session):
"types-setuptools",
"types-requests",
"types-protobuf",
"types-mock",
"types-dataclasses",
"types-mock; python_version=='3.7'",
)
session.run("mypy", "google", "tests")

Expand Down
2 changes: 1 addition & 1 deletiontests/asyncio/future/test_async_future.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,8 +13,8 @@
# limitations under the License.

importasyncio
fromunittestimportmock

importmock
importpytest

fromgoogle.api_coreimportexceptions
Expand Down
6 changes: 5 additions & 1 deletiontests/asyncio/gapic/test_method_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,11 @@

import datetime

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore
import pytest

try:
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff 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
9 changes: 7 additions & 2 deletionstests/asyncio/retry/test_retry_streaming_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,11 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import asyncio
import datetime
import re
import asyncio

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

import pytest

from google.api_core import exceptions
Expand Down
6 changes: 5 additions & 1 deletiontests/asyncio/retry/test_retry_unary_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,11 @@
import datetime
import re

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore
import pytest

from google.api_core import exceptions
Expand Down
6 changes: 5 additions & 1 deletiontests/asyncio/test_grpc_helpers_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore
import pytest # noqa: I202

try:
Expand Down
7 changes: 6 additions & 1 deletiontests/asyncio/test_operation_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,14 @@
# limitations under the License.


import mock
import pytest

try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

try:
import grpc # noqa: F401
except ImportError: # pragma: NO COVER
Expand Down
6 changes: 5 additions & 1 deletiontests/asyncio/test_page_iterator_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,11 @@

import inspect

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore
import pytest

from google.api_core import page_iterator_async
Expand Down
11 changes: 8 additions & 3 deletionstests/asyncio/test_rest_streaming_async.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,15 +15,20 @@
# TODO: set random.seed explicitly in each test function.
# See related issue: https://github.com/googleapis/python-api-core/issues/689.

import pytest # noqa: I202
import mock

import datetime
import logging
import random
import time
from typing import List, AsyncIterator

try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

import pytest # noqa: I202

import proto

try:
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/future/test__helpers.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 unittestimport mock

from google.api_core.future import _helpers

Expand Down
2 changes: 1 addition & 1 deletiontests/unit/future/test_polling.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,8 +15,8 @@
importconcurrent.futures
importthreading
importtime
fromunittestimportmock

importmock
importpytest

fromgoogle.api_coreimportexceptions,retry
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/gapic/test_method.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
7 changes: 6 additions & 1 deletiontests/unit/operations_v1/test_operations_rest_client.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,12 @@
#
import os

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

import pytest
from typing import Any, List

Expand Down
2 changes: 1 addition & 1 deletiontests/unit/retry/test_retry_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
7 changes: 6 additions & 1 deletiontests/unit/retry/test_retry_streaming.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,12 @@

import re

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

import pytest

from google.api_core import exceptions
Expand Down
8 changes: 6 additions & 2 deletionstests/unit/retry/test_retry_unary.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,10 +13,14 @@
# limitations under the License.

import datetime
import pytest
import re

import mock
import pytest
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

from google.api_core import exceptions
from google.api_core import retry
Expand Down
7 changes: 6 additions & 1 deletiontests/unit/test_bidi.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -17,7 +17,12 @@
import queue
import threading

import mock
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER # noqa: F401
except ImportError: # pragma: NO COVER
import mock # type: ignore

import pytest

try:
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/test_exceptions.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,8 +14,8 @@

importhttp.client
importjson
fromunittestimportmock

importmock
importpytest
importrequests

Expand Down
2 changes: 1 addition & 1 deletiontests/unit/test_extended_operation.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,8 +15,8 @@
importdataclasses
importenum
importtyping
fromunittestimportmock

importmock
importpytest

fromgoogle.api_coreimportexceptions
Expand Down
3 changes: 2 additions & 1 deletiontests/unit/test_grpc_helpers.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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
3 changes: 2 additions & 1 deletiontests/unit/test_operation.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,7 +13,8 @@
# limitations under the License.


importmock
fromunittestimportmock

importpytest

try:
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/test_page_iterator.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,8 +14,8 @@

importmath
importtypes
fromunittestimportmock

importmock
importpytest

fromgoogle.api_coreimportpage_iterator
Expand Down
2 changes: 1 addition & 1 deletiontests/unit/test_path_template.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,8 +13,8 @@
# limitations under the License.

from __future__importunicode_literals
fromunittestimportmock

importmock
importpytest

fromgoogle.apiimportauth_pb2
Expand Down
3 changes: 1 addition & 2 deletionstests/unit/test_timeout.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp