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

Method test_this_inst

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

Source from the content-addressed store, hash-verified

1190 self.assertRaises(TraitError, setattr, f, "this", 10)
1191
1192 def test_this_inst(self):
1193 class Foo(HasTraits):
1194 this = This["Foo"]()
1195
1196 f = Foo()
1197 f.this = Foo()
1198 self.assertTrue(isinstance(f.this, Foo))
1199
1200 def test_subclass(self):
1201 class Foo(HasTraits):

Callers

nothing calls this directly

Calls 1

FooClass · 0.70

Tested by

no test coverage detected