Skip to content

Commit 6950ab9

Browse files
committed
fix(tests): shim removed aiohttp stream mixin for vcr
VCR.py imports aiohttp.streams.AsyncStreamReaderMixin at module import time, but newer aiohttp releases removed that internal symbol. Add a no-op compatibility shim before importing the aiohttp stubs so provider test collection does not fail.
1 parent 0d6c87d commit 6950ab9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

py/src/braintrust/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ def _patch_vcr_aiohttp_stubs():
3232
See: https://github.com/kevin1024/vcrpy/issues/927
3333
"""
3434
try:
35+
from aiohttp import streams
36+
37+
# VCR.py imports this aiohttp internals symbol at module import time, but
38+
# newer aiohttp releases removed it. Provide a no-op compatibility shim
39+
# before importing vcr.stubs.aiohttp_stubs so test collection does not fail.
40+
if not hasattr(streams, "AsyncStreamReaderMixin"):
41+
setattr(streams, "AsyncStreamReaderMixin", object)
42+
3543
from vcr.stubs import aiohttp_stubs
3644
except ImportError:
3745
return

0 commit comments

Comments
 (0)