MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_no_contains_eager_opt

Method test_no_contains_eager_opt

test/orm/test_query.py:5549–5565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5547 )
5548
5549 def test_no_contains_eager_opt(self):
5550 self._eagerload_mappings()
5551
5552 User = self.classes.User
5553 sess = fixture_session()
5554 q = (
5555 sess.query(User)
5556 .join(User.addresses)
5557 .options(contains_eager(User.addresses))
5558 .yield_per(1)
5559 )
5560 assert_raises_message(
5561 sa_exc.InvalidRequestError,
5562 "Can't use yield_per with eager loaders that require "
5563 "uniquing or row buffering",
5564 q.all,
5565 )
5566
5567 def test_no_subqueryload_opt(self):
5568 self._eagerload_mappings()

Callers

nothing calls this directly

Calls 8

_eagerload_mappingsMethod · 0.95
fixture_sessionFunction · 0.90
contains_eagerFunction · 0.90
assert_raises_messageFunction · 0.90
yield_perMethod · 0.45
optionsMethod · 0.45
joinMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected