def test_ancestry(): b = B('', name='b') assert ancestry(b) == [b] assert ancestry(b.a1) == [b.a1, b] assert ancestry(b.a1.s1) == [b.a1.s1, b.a1, b]