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

Function test_super_args

tests/test_traitlets.py:2785–2799  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2783
2784
2785def test_super_args():
2786 class SuperRecorder:
2787 def __init__(self, *args, **kwargs):
2788 self.super_args = args
2789 self.super_kwargs = kwargs
2790
2791 class SuperHasTraits(HasTraits, SuperRecorder):
2792 i = Integer()
2793
2794 obj = SuperHasTraits("a1", "a2", b=10, i=5, c="x")
2795 assert obj.i == 5
2796 assert not hasattr(obj, "b")
2797 assert not hasattr(obj, "c")
2798 assert obj.super_args == ("a1", "a2")
2799 assert obj.super_kwargs == {"b": 10, "c": "x"}
2800
2801
2802def test_super_bad_args():

Callers

nothing calls this directly

Calls 1

SuperHasTraitsClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…