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

Function test_default_mro

tests/test_traitlets.py:2813–2838  ·  view source on GitHub ↗

Verify that default values follow mro

()

Source from the content-addressed store, hash-verified

2811
2812
2813def test_default_mro():
2814 """Verify that default values follow mro"""
2815
2816 class Base(HasTraits):
2817 trait = Unicode("base")
2818 attr = "base"
2819
2820 class A(Base):
2821 pass
2822
2823 class B(Base):
2824 trait = Unicode("B")
2825 attr = "B"
2826
2827 class AB(A, B):
2828 pass
2829
2830 class BA(B, A):
2831 pass
2832
2833 assert A().trait == "base"
2834 assert A().attr == "base"
2835 assert BA().trait == "B"
2836 assert BA().attr == "B"
2837 assert AB().trait == "B"
2838 assert AB().attr == "B"
2839
2840
2841def test_cls_self_argument():

Callers

nothing calls this directly

Calls 3

BAClass · 0.85
ABClass · 0.85
AClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…