Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
fix: Add async context manager return types (#255)
Browse files Browse the repository at this point in the history
* 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

* revert

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
  • Loading branch information
3 people authored Jul 4, 2023
1 parent 50400ba commit 6c2f727
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ async def sample_cancel_execution():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "ExecutionsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ async def sample_cancel_execution():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "ExecutionsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ async def sample_update_workflow():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "WorkflowsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ async def sample_update_workflow():
# Done; return the response.
return response

async def __aenter__(self):
async def __aenter__(self) -> "WorkflowsAsyncClient":
return self

async def __aexit__(self, exc_type, exc, tb):
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/executions_v1/test_executions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,11 @@ async def test_list_executions_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_executions(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/executions_v1beta/test_executions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,9 +1070,11 @@ async def test_list_executions_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_executions(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/workflows_v1/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,11 @@ async def test_list_workflows_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_workflows(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/gapic/workflows_v1beta/test_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,11 @@ async def test_list_workflows_async_pages():
RuntimeError,
)
pages = []
async for page_ in (
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
async for page_ in ( # pragma: no branch
await client.list_workflows(request={})
).pages: # pragma: no branch
).pages:
pages.append(page_)
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
assert page_.raw_page.next_page_token == token
Expand Down

0 comments on commit 6c2f727

Please sign in to comment.