MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_init_allow_kw_modify

Method test_init_allow_kw_modify

test/orm/test_events.py:1548–1557  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1546 return canary
1547
1548 def test_init_allow_kw_modify(self):
1549 User, users = self.classes.User, self.tables.users
1550 self.mapper_registry.map_imperatively(User, users)
1551
1552 @event.listens_for(User, "init")
1553 def add_name(obj, args, kwargs):
1554 kwargs["name"] = "ed"
1555
1556 u1 = User()
1557 eq_(u1.name, "ed")
1558
1559 def test_init_failure_hook(self):
1560 users = self.tables.users

Callers

nothing calls this directly

Calls 3

eq_Function · 0.90
map_imperativelyMethod · 0.80
UserClass · 0.70

Tested by

no test coverage detected