MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / go

Method go

test/orm/test_selectin_relations.py:2401–2430  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2399 session = fixture_session()
2400
2401 def go():
2402 if chunksize_spec.monkeypatch:
2403 if chunksize is None:
2404 statement = (
2405 select(A).options(selectinload(A.bs)).order_by(A.id)
2406 )
2407
2408 session.scalars(statement).all()
2409 else:
2410 with mock.patch(
2411 "sqlalchemy.orm.strategies._SelectInLoader._chunksize",
2412 chunksize,
2413 ):
2414
2415 statement = (
2416 select(A)
2417 .options(selectinload(A.bs))
2418 .order_by(A.id)
2419 )
2420
2421 session.scalars(statement).all()
2422 else:
2423
2424 statement = (
2425 select(A)
2426 .options(selectinload(A.bs, chunksize=chunksize))
2427 .order_by(A.id)
2428 )
2429
2430 session.scalars(statement).all()
2431
2432 self.assert_sql_execution(
2433 testing.db,

Callers

nothing calls this directly

Calls 11

selectFunction · 0.90
selectinloadFunction · 0.90
eq_Function · 0.90
BClass · 0.70
order_byMethod · 0.45
optionsMethod · 0.45
allMethod · 0.45
scalarsMethod · 0.45
offsetMethod · 0.45
yield_perMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected