MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_all

Method test_all

test/ext/asyncio/test_engine.py:1212–1237  ·  view source on GitHub ↗
(self, async_engine, filter_)

Source from the content-addressed store, hash-verified

1210 )
1211 @async_test
1212 async def test_all(self, async_engine, filter_):
1213 users = self.tables.users
1214 async with async_engine.connect() as conn:
1215 result = await conn.stream(select(users))
1216
1217 if filter_ == "mappings":
1218 result = result.mappings()
1219 elif filter_ == "scalars":
1220 result = result.scalars(1)
1221
1222 all_ = await result.all()
1223 if filter_ == "mappings":
1224 eq_(
1225 all_,
1226 [
1227 {"user_id": i, "user_name": "name%d" % i}
1228 for i in range(1, 20)
1229 ],
1230 )
1231 elif filter_ == "scalars":
1232 eq_(
1233 all_,
1234 ["name%d" % i for i in range(1, 20)],
1235 )
1236 else:
1237 eq_(all_, [(i, "name%d" % i) for i in range(1, 20)])
1238
1239 @testing.combinations(
1240 (None,),

Callers

nothing calls this directly

Calls 7

selectFunction · 0.90
eq_Function · 0.90
connectMethod · 0.45
streamMethod · 0.45
mappingsMethod · 0.45
scalarsMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected