Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 074edd4

Browse files
fix: Add async context manager return types (#385)
* fix: Add async context manager return types chore: Mock return_value should not populate oneof message fields chore: Support snippet generation for services that only support REST transport chore: Update gapic-generator-python to v1.11.0 PiperOrigin-RevId: 545430278 Source-Link: googleapis/googleapis@601b532 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b3f18d0f6560a855022fd058865e7620479d7af9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjNmMThkMGY2NTYwYTg1NTAyMmZkMDU4ODY1ZTc2MjA0NzlkN2FmOSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent be6b0ab commit 074edd4

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

google/cloud/container_v1/services/cluster_manager/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4697,7 +4697,7 @@ async def sample_check_autopilot_compatibility():
46974697
# Done; return the response.
46984698
return response
46994699

4700-
async def __aenter__(self):
4700+
async def __aenter__(self) -> "ClusterManagerAsyncClient":
47014701
return self
47024702

47034703
async def __aexit__(self, exc_type, exc, tb):

google/cloud/container_v1beta1/services/cluster_manager/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4884,7 +4884,7 @@ async def sample_list_locations():
48844884
# Done; return the response.
48854885
return response
48864886

4887-
async def __aenter__(self):
4887+
async def __aenter__(self) -> "ClusterManagerAsyncClient":
48884888
return self
48894889

48904890
async def __aexit__(self, exc_type, exc, tb):

tests/unit/gapic/container_v1/test_cluster_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9923,9 +9923,11 @@ async def test_list_usable_subnetworks_async_pages():
99239923
RuntimeError,
99249924
)
99259925
pages = []
9926-
async for page_ in (
9926+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
9927+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
9928+
async for page_ in ( # pragma: no branch
99279929
await client.list_usable_subnetworks(request={})
9928-
).pages: # pragma: no branch
9930+
).pages:
99299931
pages.append(page_)
99309932
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
99319933
assert page_.raw_page.next_page_token == token

tests/unit/gapic/container_v1beta1/test_cluster_manager.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10035,9 +10035,11 @@ async def test_list_usable_subnetworks_async_pages():
1003510035
RuntimeError,
1003610036
)
1003710037
pages = []
10038-
async for page_ in (
10038+
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
10039+
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
10040+
async for page_ in ( # pragma: no branch
1003910041
await client.list_usable_subnetworks(request={})
10040-
).pages: # pragma: no branch
10042+
).pages:
1004110043
pages.append(page_)
1004210044
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
1004310045
assert page_.raw_page.next_page_token == token

0 commit comments

Comments
 (0)