MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_stale_checker_linked

Method test_stale_checker_linked

test/sql/test_lambdas.py:262–287  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

260 self.assert_compile(s3, "SELECT q")
261
262 def test_stale_checker_linked(self):
263 def go(x, y):
264 stmt = lambdas.lambda_stmt(lambda: select(x)) + (
265 lambda s: s.where(y > 5)
266 )
267 return stmt
268
269 c1 = oldc1 = column("x")
270 c2 = oldc2 = column("y")
271 s1 = go(c1, c2)
272 s2 = go(c1, c2)
273
274 self.assert_compile(s1, "SELECT x WHERE y > :y_1")
275 self.assert_compile(s2, "SELECT x WHERE y > :y_1")
276
277 c1 = column("q")
278 c2 = column("p")
279
280 s3 = go(c1, c2)
281 self.assert_compile(s3, "SELECT q WHERE p > :p_1")
282
283 s4 = go(c1, c2)
284 self.assert_compile(s4, "SELECT q WHERE p > :p_1")
285
286 s5 = go(oldc1, oldc2)
287 self.assert_compile(s5, "SELECT x WHERE y > :y_1")
288
289 def test_maintain_required_bindparam(self):
290 """test that the "required" flag doesn't go away for bound

Callers

nothing calls this directly

Calls 3

columnFunction · 0.90
assert_compileMethod · 0.80
goFunction · 0.50

Tested by

no test coverage detected