File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ classifiers = [
4141 " Operating System :: OS Independent" ,
4242]
4343dependencies = [
44- " aiohttp<3.14 " ,
44+ " aiohttp" ,
4545 " cryptography>=42.0.0" ,
4646 " dnspython>=2.0.0" ,
4747 " Requests" ,
Original file line number Diff line number Diff line change 1515"""
1616
1717import asyncio
18+ import inspect
1819import os
1920import socket
2021import ssl
2122from threading import Thread
2223from typing import Any , AsyncGenerator
2324
25+ import aiohttp
2426from aiohttp import web
2527from cryptography .hazmat .primitives import serialization
2628import pytest # noqa F401 Needed to run the tests
3537from google .cloud .sql .connector .utils import generate_keys
3638from google .cloud .sql .connector .utils import write_to_file
3739
40+ # Monkeypatch aiohttp.ClientResponse.__init__ to support aioresponses with aiohttp >= 3.11/3.14
41+ _original_client_response_init = aiohttp .ClientResponse .__init__
42+
43+
44+ def _patched_client_response_init (self , * args , ** kwargs ):
45+ sig = inspect .signature (_original_client_response_init )
46+ if "stream_writer" in sig .parameters and "stream_writer" not in kwargs :
47+ kwargs ["stream_writer" ] = kwargs .get ("writer" , None )
48+ return _original_client_response_init (self , * args , ** kwargs )
49+
50+
51+ aiohttp .ClientResponse .__init__ = _patched_client_response_init
52+
3853SCOPES = ["https://www.googleapis.com/auth/sqlservice.admin" ]
3954
4055
You can’t perform that action at this time.
0 commit comments