[Python-Dev] Does trace modules have a unit test?

Eli Bendersky eliben at gmail.com
Mon Jul 19 06:12:04 CEST 2010


On Mon, Jul 19, 2010 at 07:02, Terry Reedy <tjreedy at udel.edu> wrote:

> In reviewing
> http://bugs.python.org/issue9282
> the issue came up, where is the unit test for trace.py?
>
> test/test_trace.py is actually a test of the line trace facility of
> sys.settrace (and should have been called test_linetrace or test_settrace).
> The only trace import Eli could find in Lib/test is the one in regrtest.py
> for the -T option. Have we missed something?
>
> If you say 'make one', what should be its name? Can the existing file be
> renamed (I gather this can be a bit of a problem)?
>

I'd like to ask pydev another question on this issue. When thinking about
adding unit tests for trace.py, I quickly realized it's not a usual module.
Most of its output is either tracing reports to stdout, or even worse, to
special files named <modname>.cover

stdout output can be captured, but what about the .cover files? Can a Python
unit test create temporary files in tmp/ (or somewhere else) as part of its
testing, or is this forbidden?

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100719/82adb24f/attachment-0001.html>


More information about the Python-Dev mailing list