Repository navigation
test(google-genai): remove vcrpy aiohttp workaround fixed in vcrpy 8.5.0 - #377
Open
pylaterreur wants to merge 1 commit into
Open
pylaterreur wants to merge 1 commit into
pylaterreur wants to merge 1 commit into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
srv-gh-o11y-gdi-cla
added a commit
to splunk/cla-agreement
that referenced
this pull request
Sep 30, 2026
The patch_vcr_aiohttp_stream fixture in test_e2e.py works around kevin1024/vcrpy#927 with a MockClientResponse subclass whose `content` property caches one stream. vcrpy 8.5.0 includes kevin1024/vcrpy#1055, which fixes that bug: `content` is a plain attribute holding one aiohttp StreamReader, and MockStream requires the body. With vcrpy 8.5.0 or newer, the fixture makes every async replay in this module fail with a TypeError: aiohttp's close() reads `content`, and the property then creates _ReplayMockStream() without a body. The test requirements don't pin vcrpy, so a fresh environment gets such a release. Remove the fixture and the imports only it used, and require vcrpy 8.5.0 or newer in requirements.latest.txt.
pylaterreur
force-pushed
the
vcrpy-1055-aiohttp-workaround
branch
from
October 25, 2026 22:36
7399e6d to
a61dca8
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The autouse
patch_vcr_aiohttp_streamfixture intests/generate_content/test_e2e.pyworks around kevin1024/vcrpy#927 by replacing vcrpy'sMockClientResponsewith a subclass whosecontentproperty caches one stream. vcrpy 8.5.0, released on 2026-10-25, includes kevin1024/vcrpy#1055, which fixes that bug:contentis a plain attribute holding one aiohttpStreamReader, andMockStreamrequires the body. With vcrpy 8.5.0 or newer, every async replay in this module fails withTypeError: MockStream.__init__() missing 1 required positional argument: 'body', because aiohttp'sclose()readscontentand the fixture's property calls_ReplayMockStream()without a body. The test requirements don't pin vcrpy, so a fresh environment gets such a release. CI doesn't run these tests.Changes
tests/requirements.latest.txt.Unreleasedin the package CHANGELOG.Validation
test_e2e.pyreplayed with--vcr-record=noneon Python 3.12 (google-genai 1.64.0, aiohttp 3.14.5), one process per test, since in one session only the first test sees spans (theTelemetryHandlersingleton isn't reset):On 8.4.0, the two
test_streaming[*-async-default]cases never finish without the fixture (kevin1024/vcrpy#927, stopped bypytest-timeoutafter 60 s). The 4test_upload_hook_non_streamingcases fail onmainwith every vcrpy version.ruff checkandruff format --checkpass.🤖 Generated with Claude Code
https://claude.ai/code/session_01GwUvhmzgfkiZ6vo4uGyesN