MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_implicitly_boolean

Method test_implicitly_boolean

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

Source from the content-addressed store, hash-verified

2967 )
2968
2969 def test_implicitly_boolean(self):
2970 # test for expressions that the database always considers as boolean
2971 # even if there is no boolean datatype.
2972 assert not self.table1.c.myid._is_implicitly_boolean
2973 assert (self.table1.c.myid == 5)._is_implicitly_boolean
2974 assert (self.table1.c.myid == 5).self_group()._is_implicitly_boolean
2975 assert (self.table1.c.myid == 5).label("x")._is_implicitly_boolean
2976 assert not_(self.table1.c.myid == 5)._is_implicitly_boolean
2977 assert or_(
2978 self.table1.c.myid == 5, self.table1.c.myid == 7
2979 )._is_implicitly_boolean
2980 assert not column("x", Boolean)._is_implicitly_boolean
2981 assert not (self.table1.c.myid + 5)._is_implicitly_boolean
2982 assert not not_(column("x", Boolean))._is_implicitly_boolean
2983 assert (
2984 not select(self.table1.c.myid)
2985 .scalar_subquery()
2986 ._is_implicitly_boolean
2987 )
2988 assert not text("x = y")._is_implicitly_boolean
2989 assert not literal_column("x = y")._is_implicitly_boolean
2990
2991 def test_scalar_select(self):
2992 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