MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_we_dont_call_bool

Method test_we_dont_call_bool

test/orm/test_mapper.py:1568–1579  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1566 s.commit()
1567
1568 def test_we_dont_call_bool(self):
1569 class NoBoolAllowed:
1570 def __bool__(self):
1571 raise Exception("nope")
1572
1573 self.mapper(NoBoolAllowed, self.tables.users)
1574 u1 = NoBoolAllowed()
1575 u1.name = "some name"
1576 s = Session(testing.db)
1577 s.add(u1)
1578 s.commit()
1579 assert s.get(NoBoolAllowed, u1.id) is u1
1580
1581 def test_we_dont_call_eq(self):
1582 class NoEqAllowed:

Callers

nothing calls this directly

Calls 6

addMethod · 0.95
commitMethod · 0.95
getMethod · 0.95
SessionClass · 0.90
NoBoolAllowedClass · 0.85
mapperMethod · 0.45

Tested by

no test coverage detected