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

Method test_setup_instance

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

Source from the content-addressed store, hash-verified

411
412class TestHasDescriptors(TestCase):
413 def test_setup_instance(self):
414 class FooDescriptor(BaseDescriptor):
415 def instance_init(self, inst):
416 foo = inst.foo # instance should have the attr
417
418 class HasFooDescriptors(HasDescriptors):
419 fd = FooDescriptor()
420
421 def setup_instance(self, *args, **kwargs):
422 self.foo = kwargs.get("foo", None)
423 super().setup_instance(*args, **kwargs)
424
425 hfd = HasFooDescriptors(foo="bar")
426
427
428class TestHasTraitsNotify(TestCase):

Callers

nothing calls this directly

Calls 1

HasFooDescriptorsClass · 0.85

Tested by

no test coverage detected