Skip to content

Commit a3f454d

Browse files
xiangyan99chlowellmccoypAzure CLI BotSDKAuto
authored
leave stream open in response (Azure#19711)
* leave stream open in response * update * Get latest main (Azure#19733) * Credentials accept tenant_id argument to get_token (Azure#19602) * Update changelog for azure-identity 1.7.0b2 (Azure#19693) * [Key Vault] Drop 3.5 support for keys (Azure#19712) * [AutoRelease] t2-compute-2021-07-08-85328 (Azure#19715) * CodeGen from PR 14638 in Azure/azure-rest-api-specs Move RestorePoint properties into new properties bag for restore point (Azure#14638) * version,CHANGELOG * test Co-authored-by: SDKAuto <[email protected]> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> * debug_guide for python SDK (Azure#19716) * Increment package version after release of azure-servicebus (Azure#19709) * Increment package version after release of azure-identity (Azure#19721) * Prevent DeprecationWarning in Identity tests (Azure#19723) * move _utils.py (Azure#19431) * move _utils.py * update * [QnA] Initial SDK (Azure#19544) * Template + first code gen * Basic client * First tests * Added async client + tests * Added answerspan test * Added authoring APIs * Some updates * Pure generated clients * Test updates * Update test imports * Clean working recordings * Renamed directory * Removed authoring for now * Use unreleased core * Remove conversation + ci yaml * Some CI updates * update language __init__.py to not have a space in the name * Setup.py * Updated core dependency * CI fixes * Added language nspkg * Fix Python 2.7 * Added some more tests * Test fixes * Added live configuration * Bumped msrest * readme + samples * No pypi or refdocs yet * Review feedback Co-authored-by: scbedd <[email protected]> * fix broken rest due to utils movement (Azure#19728) * handle details "null" (Azure#19430) * handle details "null" * update * Bump aiohttp from 3.5.4 to 3.7.4 in /common/smoketest (Azure#19330) Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.5.4 to 3.7.4. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](aio-libs/aiohttp@v3.5.4...v3.7.4) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Lowell <[email protected]> Co-authored-by: McCoy Patiño <[email protected]> Co-authored-by: Azure CLI Bot <[email protected]> Co-authored-by: SDKAuto <[email protected]> Co-authored-by: msyyc <[email protected]> Co-authored-by: Azure SDK Bot <[email protected]> Co-authored-by: annatisch <[email protected]> Co-authored-by: scbedd <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Charles Lowell <[email protected]> Co-authored-by: McCoy Patiño <[email protected]> Co-authored-by: Azure CLI Bot <[email protected]> Co-authored-by: SDKAuto <[email protected]> Co-authored-by: msyyc <[email protected]> Co-authored-by: Azure SDK Bot <[email protected]> Co-authored-by: annatisch <[email protected]> Co-authored-by: scbedd <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 73406cc commit a3f454d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tools/vcrpy/vcr/stubs/aiohttp_stubs/__init__.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def __init__(self, method, url, request_info=None):
3232
loop=asyncio.get_event_loop(),
3333
session=None,
3434
)
35+
self._content = None
3536

3637
async def json(self, *, encoding="utf-8", loads=json.loads, **kwargs): # NOQA: E999
3738
stripped = self._body.strip()
@@ -51,10 +52,11 @@ def release(self):
5152

5253
@property
5354
def content(self):
54-
s = MockStream()
55-
s.feed_data(self._body)
56-
s.feed_eof()
57-
return s
55+
if not self._content:
56+
self._content = MockStream()
57+
self._content.feed_data(self._body)
58+
self._content.feed_eof()
59+
return self._content
5860

5961

6062
def build_response(vcr_request, vcr_response, history):
@@ -71,7 +73,6 @@ def build_response(vcr_request, vcr_response, history):
7173
response._headers = CIMultiDictProxy(CIMultiDict(vcr_response["headers"]))
7274
response._history = tuple(history)
7375

74-
response.close()
7576
return response
7677

7778

0 commit comments

Comments
 (0)