[issue16079] list duplicate test names with patchcheck
Xavier de Gaye
report at bugs.python.org
Fri Sep 28 21:52:51 CEST 2012
Xavier de Gaye added the comment:
Note that using the module code object to find duplicates does not
allow for selecting among the different code types: function, nested
function, method or class.
Duplicates are extensively used within the std lib:
Running find_duplicate_test_names.py, the initial script from issue
16056, on the whole std lib instead of just Lib/test, after updating
the script to list all the duplicates (except <lambda>, <genexp>,
...) with:
if not name[-1].startswith('<'):
yield '.'.join(name)
prints 347 (on a total of 1368 std lib .py files) duplicate
functions, methods or classes.
To eliminate module level functions (but not nested functions), the
script is run now with the following change:
if len(name) > 2 and not name[-1].startswith('<'):
yield '.'.join(name)
and lists 188 duplicate nested functions, methods or classes. In
this list there are 131 duplicates in .py files located in the
subdirectory of a "test" directory.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16079>
_______________________________________
More information about the Python-bugs-list
mailing list