mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #18830: inspect.getclasstree() no more produces duplicated entries even
when input list contains duplicates.
This commit is contained in:
parent
e1040e276b
commit
362c1b513d
4 changed files with 26 additions and 3 deletions
|
@ -224,8 +224,25 @@ class TestRetrievingSourceCode(GetSourceBase):
|
|||
[('FesteringGob', mod.FesteringGob),
|
||||
('MalodorousPervert', mod.MalodorousPervert),
|
||||
('ParrotDroppings', mod.ParrotDroppings),
|
||||
('StupidGit', mod.StupidGit)])
|
||||
tree = inspect.getclasstree([cls[1] for cls in classes], 1)
|
||||
('StupidGit', mod.StupidGit),
|
||||
('Tit', mod.MalodorousPervert),
|
||||
])
|
||||
tree = inspect.getclasstree([cls[1] for cls in classes])
|
||||
self.assertEqual(tree,
|
||||
[(object, ()),
|
||||
[(mod.ParrotDroppings, (object,)),
|
||||
[(mod.FesteringGob, (mod.MalodorousPervert,
|
||||
mod.ParrotDroppings))
|
||||
],
|
||||
(mod.StupidGit, (object,)),
|
||||
[(mod.MalodorousPervert, (mod.StupidGit,)),
|
||||
[(mod.FesteringGob, (mod.MalodorousPervert,
|
||||
mod.ParrotDroppings))
|
||||
]
|
||||
]
|
||||
]
|
||||
])
|
||||
tree = inspect.getclasstree([cls[1] for cls in classes], True)
|
||||
self.assertEqual(tree,
|
||||
[(object, ()),
|
||||
[(mod.ParrotDroppings, (object,)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue