MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_whereclause

Method test_select_whereclause

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

Source from the content-addressed store, hash-verified

68 )
69
70 def test_select_whereclause(self):
71 t1 = table("t1", column("q"), column("p"))
72
73 x = 10
74 y = 5
75
76 def go():
77 return select(t1).where(lambda: and_(t1.c.q == x, t1.c.p == y))
78
79 self.assert_compile(
80 go(), "SELECT t1.q, t1.p FROM t1 WHERE t1.q = :x_1 AND t1.p = :y_1"
81 )
82
83 self.assert_compile(
84 go(), "SELECT t1.q, t1.p FROM t1 WHERE t1.q = :x_1 AND t1.p = :y_1"
85 )
86
87 def test_global_tracking(self):
88 t1 = table("t1", column("q"), column("p"))

Callers

nothing calls this directly

Calls 4

tableFunction · 0.90
columnFunction · 0.90
assert_compileMethod · 0.80
goFunction · 0.50

Tested by

no test coverage detected