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

Method test_parent

tests/config/test_configurable.py:147–159  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

145 self.assertEqual(c2.b, config.MyConfigurable.b)
146
147 def test_parent(self):
148 config = Config()
149 config.Foo.a = 10
150 config.Foo.b = "wow"
151 config.Bar.b = "later"
152 config.Bar.c = 100.0
153 f = Foo(config=config)
154 with expected_warnings(["`b` not recognized"]):
155 b = Bar(config=f.config)
156 self.assertEqual(f.a, 10)
157 self.assertEqual(f.b, "wow")
158 self.assertEqual(b.b, "gotit")
159 self.assertEqual(b.c, 100.0)
160
161 def test_override1(self):
162 config = Config()

Callers

nothing calls this directly

Calls 4

ConfigClass · 0.90
expected_warningsFunction · 0.90
FooClass · 0.70
BarClass · 0.70

Tested by

no test coverage detected