MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_eager_load

Method test_eager_load

test/orm/test_composites.py:188–206  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

186 eq_(e1.end, Point(None, None))
187
188 def test_eager_load(self):
189 Graph, Point = self.classes.Graph, self.classes.Point
190
191 sess = self._fixture()
192
193 g = sess.query(Graph).first()
194 sess.close()
195
196 def go():
197 g2 = sess.get(
198 Graph, g.id, options=[sa.orm.joinedload(Graph.edges)]
199 )
200
201 eq_(
202 [(e.start, e.end) for e in g2.edges],
203 [(Point(3, 4), Point(5, 6)), (Point(14, 5), Point(2, 7))],
204 )
205
206 self.assert_sql_count(testing.db, go, 1)
207
208 def test_comparator(self):
209 Graph, Edge, Point = (

Callers

nothing calls this directly

Calls 5

_fixtureMethod · 0.95
assert_sql_countMethod · 0.80
firstMethod · 0.45
queryMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected