MCPcopy Create free account
hub / github.com/ipython/traitlets / test_subclass

Method test_subclass

tests/test_traitlets.py:1200–1212  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1198 self.assertTrue(isinstance(f.this, Foo))
1199
1200 def test_subclass(self):
1201 class Foo(HasTraits):
1202 t = This["Foo"]()
1203
1204 class Bar(Foo):
1205 pass
1206
1207 f = Foo()
1208 b = Bar()
1209 f.t = b
1210 b.t = f
1211 self.assertEqual(f.t, b)
1212 self.assertEqual(b.t, f)
1213
1214 def test_subclass_override(self):
1215 class Foo(HasTraits):

Callers

nothing calls this directly

Calls 2

FooClass · 0.70
BarClass · 0.70

Tested by

no test coverage detected