Ezio Melotti <ezio.melo...@gmail.com> added the comment:

Here's a working patch (without docs and tests).
I managed to filter the warnings by message without introducing a new type of 
warning. As it is, all the warnings related to deprecated unittest methods are 
printed only once per module, regardless of what methods are used and how many 
times.
I'm also thinking that it might be better to include the name of the deprecated 
method in the message and use three filters for fail* methods, assert* methods, 
and the assert*Regexp* methods that will be deprecated. This will show at worst 
3 warnings per module, but the assert*Regexp* and the fail* methods are not so 
common, so it shouldn't be too nosy.
One "limitation" of the patch is that the per-module special-casing for 
unittest is not affect by the `warnings` argument, but it can be changed when 
-W is used and no `warnings` arg is passed.

Regrtest doesn't seem to use unittest, so it should be fixed separately 
(probably needs another issue).

----------
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file19821/issue10535.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10535>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to