[New-bugs-announce] [issue17696] lookup fails for renamed functions

Ulrich Eckhardt report at bugs.python.org
Thu Apr 11 09:08:20 CEST 2013

New submission from Ulrich Eckhardt:

When you rename a test function, you can't explicitly specify it on the commandline any more. During normal test runs, it is automatically discovered though. The error is that the old name was not found, even though the new name was specified. The attached example changes the name attached to the function (its __name__ attribute) for demonstration. The same problem occurs if you auto-generate test functions and attach them to the class, using post-processing or a metaclass. The cases all have in common that the name in the class' dict is not the same as the function's __name__, so cls.foo.__name__ is not "foo".

See http://mail.python.org/pipermail/python-list/2013-April/644863.html for the initial discussion on the mailinglist. While I only tested Python 2.7 there, it also fails for 3.2 and 3.3.

components: Tests
files: name_mod.py
messages: 186549
nosy: eckhardt
priority: normal
severity: normal
status: open
title: lookup fails for renamed functions
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file29775/name_mod.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list