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

Class TestInstanceList

tests/test_traitlets.py:1701–1718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1699
1700
1701class TestInstanceList(TraitTestBase):
1702 obj = InstanceListTrait()
1703
1704 def test_klass(self):
1705 """Test that the instance klass is properly assigned."""
1706 self.assertIs(self.obj.traits()["value"]._trait.klass, Foo)
1707
1708 _default_value: t.List[t.Any] = []
1709 _good_values = [[Foo(), Foo()], []]
1710 _bad_values = [
1711 [
1712 "1",
1713 2,
1714 ],
1715 "1",
1716 [Foo],
1717 None,
1718 ]
1719
1720
1721class UnionListTrait(HasTraits):

Callers

nothing calls this directly

Calls 2

InstanceListTraitClass · 0.85
FooClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…