[Python-ideas] unittest and warnings

Giampaolo Rodola' g.rodola at gmail.com
Mon Jun 17 20:42:11 CEST 2013


2013/6/17 Barry Warsaw <barry at python.org>

> > That doesn't really work so well.  Those errors don't get turned into
> exceptions that cause tests to fail, so they still don't show up in the
test
> suite's summary.

Exactly.
Speaking of which, maybe there's some space for introducing some APIs after
all.
By default unittest should just show warnings in the summary but there
might also be an option (settable both from cmdline and / or from code)
which turns those warnings into actual exceptions / errors.
In an ideal world CPython tests might even have that enabled that by
default.

> +1 for Giampaolo's original suggestion that skipped tests be described in
the
> summary.

I guess here you meant "tests producing warnings", right?

> ResourceWarnings are particularly difficult to track down,
> as described in my previous message to this list.

They are indeed. Very often the traceback message gives no clue at all.
Perhaps there's also space for improvements here (make the traceback longer
/ more detailed).


- Giampaolo
https://code.google.com/p/pyftpdlib
https://code.google.com/p/psutil
https://code.google.com/p/pysendfile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130617/7eb6e00f/attachment.html>


More information about the Python-ideas mailing list