MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_with_session

Method test_with_session

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

Source from the content-addressed store, hash-verified

104 run_inserts = None
105
106 def test_with_session(self):
107 User = self.classes.User
108 s1 = fixture_session()
109 s2 = fixture_session()
110 q1 = s1.query(User)
111 q2 = q1.with_session(s2)
112 assert q2.session is s2
113 assert q1.session is s1
114
115 @testing.combinations(
116 (lambda s, User: s.query(User)),

Callers

nothing calls this directly

Calls 3

fixture_sessionFunction · 0.90
with_sessionMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected