Skip to content

Commit fc20a02

Browse files
chore: update asyncpg MCP test
1 parent fc6acbf commit fc20a02

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/system/test_asyncpg_connection.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ async def create_sqlalchemy_engine(
3535
ip_type: str = "public",
3636
refresh_strategy: str = "background",
3737
resolver: Union[type[DefaultResolver], type[DnsResolver]] = DefaultResolver,
38+
**kwargs: Any,
3839
) -> tuple[sqlalchemy.ext.asyncio.engine.AsyncEngine, Connector]:
3940
"""Creates a connection pool for a Cloud SQL instance and returns the pool
4041
and the connector. Callers are responsible for closing the pool and the
@@ -92,6 +93,7 @@ async def create_sqlalchemy_engine(
9293
password=password,
9394
db=db,
9495
ip_type=ip_type, # can be "public", "private" or "psc"
96+
**kwargs, # additional asyncpg connection args
9597
),
9698
execution_options={"isolation_level": "AUTOCOMMIT"},
9799
)
@@ -229,7 +231,12 @@ async def test_MCP_sqlalchemy_connection_with_asyncpg() -> None:
229231
ip_type = os.environ.get("IP_TYPE", "public")
230232

231233
pool, connector = await create_sqlalchemy_engine(
232-
inst_conn_name, user, password, db, ip_type
234+
inst_conn_name,
235+
user,
236+
password,
237+
db,
238+
ip_type,
239+
statement_cache_size=0,
233240
)
234241

235242
async with pool.connect() as conn:

0 commit comments

Comments
 (0)