-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[formrecognizer] reduce time for recorded tests runs (#11970)
* wip * wip * add transport wrapper for get clients * fix mypy * fix * refactor * pass through kwargs * add polling interval tests * feedback
- Loading branch information
1 parent
4ee3368
commit 010bc93
Showing
29 changed files
with
1,551 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_helpers_async.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# coding=utf-8 | ||
# ------------------------------------ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# ------------------------------------ | ||
|
||
from azure.core.pipeline.transport import AsyncHttpTransport | ||
|
||
|
||
class AsyncTransportWrapper(AsyncHttpTransport): | ||
"""Wrapper class that ensures that an inner client created | ||
by a `get_client` method does not close the outer transport for the parent | ||
when used in a context manager. | ||
""" | ||
def __init__(self, async_transport): | ||
self._transport = async_transport | ||
|
||
async def send(self, request, **kwargs): | ||
return await self._transport.send(request, **kwargs) | ||
|
||
async def open(self): | ||
pass | ||
|
||
async def close(self): | ||
pass | ||
|
||
async def __aenter__(self): | ||
pass | ||
|
||
async def __aexit__(self, *args): # pylint: disable=arguments-differ | ||
pass |
Oops, something went wrong.