MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_ad_hoc_lazy

Method test_ad_hoc_lazy

test/orm/test_attributes.py:3981–3988  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3979 assert_warns(Warning, coll.append, B())
3980
3981 def test_ad_hoc_lazy(self):
3982 A, B = self.A, self.B
3983 a1 = A()
3984 coll = a1.bs
3985 a1.bs.append(B())
3986 state = attributes.instance_state(a1)
3987 _set_callable(state, state.dict, "bs", lambda: B())
3988 assert_warns(Warning, coll.append, B())

Callers

nothing calls this directly

Calls 5

assert_warnsFunction · 0.90
_set_callableFunction · 0.85
AClass · 0.70
BClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected