MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_implicitly_boolean

Method test_implicitly_boolean

test/sql/test_operators.py:3160–3180  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3158 )
3159
3160 def test_implicitly_boolean(self):
3161 # test for expressions that the database always considers as boolean
3162 # even if there is no boolean datatype.
3163 assert not self.table1.c.myid._is_implicitly_boolean
3164 assert (self.table1.c.myid == 5)._is_implicitly_boolean
3165 assert (self.table1.c.myid == 5).self_group()._is_implicitly_boolean
3166 assert (self.table1.c.myid == 5).label("x")._is_implicitly_boolean
3167 assert not_(self.table1.c.myid == 5)._is_implicitly_boolean
3168 assert or_(
3169 self.table1.c.myid == 5, self.table1.c.myid == 7
3170 )._is_implicitly_boolean
3171 assert not column("x", Boolean)._is_implicitly_boolean
3172 assert not (self.table1.c.myid + 5)._is_implicitly_boolean
3173 assert not not_(column("x", Boolean))._is_implicitly_boolean
3174 assert (
3175 not select(self.table1.c.myid)
3176 .scalar_subquery()
3177 ._is_implicitly_boolean
3178 )
3179 assert not text("x = y")._is_implicitly_boolean
3180 assert not literal_column("x = y")._is_implicitly_boolean
3181
3182 def test_scalar_select(self):
3183 t = self.table1

Callers

nothing calls this directly

Calls 9

not_Function · 0.90
or_Function · 0.90
columnFunction · 0.90
textFunction · 0.90
literal_columnFunction · 0.90
selectFunction · 0.85
self_groupMethod · 0.45
labelMethod · 0.45
scalar_subqueryMethod · 0.45

Tested by

no test coverage detected