MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_execute_boolean

Method test_execute_boolean

test/sql/test_lambdas.py:128–149  ·  view source on GitHub ↗
(self, boolean_table_fixture, connection)

Source from the content-addressed store, hash-verified

126 )
127
128 def test_execute_boolean(self, boolean_table_fixture, connection):
129 boolean_data = boolean_table_fixture
130
131 connection.execute(
132 boolean_data.insert(),
133 [{"id": 1, "data": True}, {"id": 2, "data": False}],
134 )
135
136 xy = True
137
138 def go():
139 stmt = select(lambda: boolean_data.c.id).where(
140 lambda: boolean_data.c.data == xy
141 )
142 return connection.execute(stmt)
143
144 result = go()
145 eq_(result.all(), [(1,)])
146
147 xy = False
148 result = go()
149 eq_(result.all(), [(2,)])
150
151 def test_in_expressions(self, user_address_fixture, connection):
152 """test #6397. we initially were going to use two different

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
goFunction · 0.50
executeMethod · 0.45
insertMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected