MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_clslevel_subclass

Method test_clslevel_subclass

test/base/test_events.py:1427–1444  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1425 eq_(m1.mock_calls, [call("x")])
1426
1427 def test_clslevel_subclass(self):
1428 Target = self._fixture()
1429
1430 class SubTarget(Target):
1431 pass
1432
1433 m1 = Mock()
1434
1435 event.listen(Target, "event_two", m1)
1436
1437 t1 = SubTarget()
1438 t1.dispatch.event_two("x")
1439
1440 event.remove(Target, "event_two", m1)
1441
1442 t1.dispatch.event_two("y")
1443
1444 eq_(m1.mock_calls, [call("x")])
1445
1446 def test_instance(self):
1447 Target = self._fixture()

Callers

nothing calls this directly

Calls 7

_fixtureMethod · 0.95
eq_Function · 0.90
callFunction · 0.85
SubTargetClass · 0.70
listenMethod · 0.45
event_twoMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected