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

Commit4db4bbf

Browse files
committed
Switch to unittest.mock from mock
Now that the minimum supported version of Python is 3.7, we can stopusing the external mock requirement, and import it from unittest. I havealso attempted to keep imports ordered.Fixes#377
1 parent84bf637 commit4db4bbf

25 files changed

+32
-30
lines changed

‎noxfile.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ def default(session, install_grpc=True, prerelease=False, install_async_rest=Fal
124124

125125
session.install(
126126
"dataclasses",
127-
"mock",
128127
"pytest",
129128
"pytest-cov",
130129
"pytest-xdist",
@@ -280,7 +279,6 @@ def mypy(session):
280279
"types-setuptools",
281280
"types-requests",
282281
"types-protobuf",
283-
"types-mock",
284282
"types-dataclasses",
285283
)
286284
session.run("mypy","google","tests")

‎tests/asyncio/future/test_async_future.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
importasyncio
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
fromgoogle.api_coreimportexceptions

‎tests/asyncio/gapic/test_method_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
importdatetime
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
try:

‎tests/asyncio/operations_v1/test_operations_async_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
importmock
15+
fromunittestimportmock
16+
1617
importpytest
1718

1819
try:

‎tests/asyncio/retry/test_retry_streaming_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
importasyncio
1516
importdatetime
1617
importre
17-
importasyncio
18+
fromunittestimportmock
1819

19-
importmock
2020
importpytest
2121

2222
fromgoogle.api_coreimportexceptions

‎tests/asyncio/retry/test_retry_unary_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
importdatetime
1616
importre
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020

2121
fromgoogle.api_coreimportexceptions

‎tests/asyncio/test_grpc_helpers_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
importmock
15+
fromunittestimportmock
16+
1617
importpytest# noqa: I202
1718

1819
try:

‎tests/asyncio/test_operation_async.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515

16-
importmock
16+
fromunittestimportmock
17+
1718
importpytest
1819

1920
try:

‎tests/asyncio/test_page_iterator_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
importinspect
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
fromgoogle.api_coreimportpage_iterator_async

‎tests/asyncio/test_rest_streaming_async.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
# TODO: set random.seed explicitly in each test function.
1616
# See related issue: https://github.com/googleapis/python-api-core/issues/689.
1717

18-
importpytest# noqa: I202
19-
importmock
20-
2118
importdatetime
2219
importlogging
2320
importrandom
2421
importtime
2522
fromtypingimportList,AsyncIterator
23+
fromunittestimportmock
24+
25+
importpytest# noqa: I202
2626

2727
importproto
2828

‎tests/unit/future/test__helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
importmock
15+
fromunittestimportmock
1616

1717
fromgoogle.api_core.futureimport_helpers
1818

‎tests/unit/future/test_polling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
importconcurrent.futures
1616
importthreading
1717
importtime
18+
fromunittestimportmock
1819

19-
importmock
2020
importpytest
2121

2222
fromgoogle.api_coreimportexceptions,retry

‎tests/unit/gapic/test_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
importdatetime
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
try:

‎tests/unit/operations_v1/test_operations_rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
#
1616
importos
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020

2121
try:

‎tests/unit/retry/test_retry_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
importitertools
1616
importre
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020
importrequests.exceptions
2121

‎tests/unit/retry/test_retry_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
importre
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
fromgoogle.api_coreimportexceptions

‎tests/unit/retry/test_retry_unary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
importdatetime
1616
importre
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020

2121
fromgoogle.api_coreimportexceptions

‎tests/unit/test_bidi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
importlogging
1717
importqueue
1818
importthreading
19+
fromunittestimportmock
1920

20-
importmock
2121
importpytest
2222

2323
try:

‎tests/unit/test_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
importhttp.client
1616
importjson
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020
importrequests
2121

‎tests/unit/test_extended_operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
importdataclasses
1616
importenum
1717
importtyping
18+
fromunittestimportmock
1819

19-
importmock
2020
importpytest
2121

2222
fromgoogle.api_coreimportexceptions

‎tests/unit/test_grpc_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
importmock
15+
fromunittestimportmock
16+
1617
importpytest
1718

1819
try:

‎tests/unit/test_operation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515

16-
importmock
16+
fromunittestimportmock
17+
1718
importpytest
1819

1920
try:

‎tests/unit/test_page_iterator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
importmath
1616
importtypes
17+
fromunittestimportmock
1718

18-
importmock
1919
importpytest
2020

2121
fromgoogle.api_coreimportpage_iterator

‎tests/unit/test_path_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
from __future__importunicode_literals
16+
fromunittestimportmock
1617

17-
importmock
1818
importpytest
1919

2020
fromgoogle.apiimportauth_pb2

‎tests/unit/test_timeout.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
importdatetime
1616
importitertools
17-
18-
importmock
17+
fromunittestimportmock
1918

2019
fromgoogle.api_coreimporttimeoutastimeouts
2120

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp