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

Function test_enum_no_default

tests/test_traitlets.py:2603–2617  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2601
2602
2603def test_enum_no_default():
2604 class C(HasTraits):
2605 t = Enum(["a", "b"])
2606
2607 c = C()
2608 c.t = "a"
2609 assert c.t == "a"
2610
2611 c = C()
2612
2613 with pytest.raises(TraitError):
2614 t = c.t
2615
2616 c = C(t="b")
2617 assert c.t == "b"
2618
2619
2620def test_default_value_repr():

Callers

nothing calls this directly

Calls 1

CClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…