MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_cursor_close

Method test_cursor_close

test/ext/asyncio/test_engine.py:1478–1488  ·  view source on GitHub ↗
(self, async_engine, case)

Source from the content-addressed store, hash-verified

1476 @async_test
1477 @testing.combinations(("stream",), ("execute",), argnames="case")
1478 async def test_cursor_close(self, async_engine, case):
1479 users = self.tables.users
1480 async with async_engine.connect() as conn:
1481 if case == "stream":
1482 result = await conn.stream(select(users))
1483 cursor = result._real_result.cursor
1484 elif case == "execute":
1485 result = await conn.execute(select(users))
1486 cursor = result.cursor
1487
1488 await conn.run_sync(lambda _: cursor.close())
1489
1490 @async_test
1491 @testing.variation("case", ["scalar_one", "scalar_one_or_none", "scalar"])

Callers

nothing calls this directly

Calls 6

selectFunction · 0.90
connectMethod · 0.45
streamMethod · 0.45
executeMethod · 0.45
run_syncMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected