def test_itersubclasses(): class A(object): pass class Aa(A): pass class Ab(A): pass class Aaa(Aa): pass class OldStyleClass: pass name = lambda x: x.__name__ assert_equal(list(map(name, u.itersubclasses(A))), ['Aa', 'Aaa', 'Ab']) if six.PY2: with assert_raises(TypeError): list(u.itersubclasses(OldStyleClass))
def test_itersubclasses(): class A: pass class Aa(A): pass class Ab(A): pass class Aaa(Aa): pass name = lambda x: x.__name__ assert list(map(name, u.itersubclasses(A))) == ["Aa", "Aaa", "Ab"]
def test_itersubclasses(): class A: pass class Aa(A): pass class Ab(A): pass class Aaa(Aa): pass name = lambda x: x.__name__ assert_equal(list(map(name, u.itersubclasses(A))), ['Aa', 'Aaa', 'Ab'])
def test_itersubclasses_from_type(): list(u.itersubclasses(type))