Message186549
| Author |
eckhardt |
| Recipients |
eckhardt |
| Date |
2013年04月11日.07:08:19 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1365664100.2.0.310972176949.issue17696@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年04月11日 07:08:20 | eckhardt | set | recipients:
+ eckhardt |
| 2013年04月11日 07:08:20 | eckhardt | set | messageid: <1365664100.2.0.310972176949.issue17696@psf.upfronthosting.co.za> |
| 2013年04月11日 07:08:20 | eckhardt | link | issue17696 messages |
| 2013年04月11日 07:08:19 | eckhardt | create |
|