How do I use trace to generate coverage data in multi-threaded programs?

Noah noah at noah.org
Thu Dec 20 19:37:19 EST 2007


On Dec 19, 7:33 pm, Noah <n... at noah.org> wrote:
>     /usr/lib/python2.5/trace.py --missing --count --summary tools/testall.py
>
> When I examine the *.cover files that are generated after a test run
> I do not see coverage information for the methods that were run
> in a separate thread. How can I collect coverage information for
> methods that only run in a separate thread (never in the main thread)?

Just for the record, the problem was due to the fact that I was
creating threads
using the "thread" module. When I switched to creating threads using
the
"threading" module I was able to see my thread code in coverage
reports.

--
Noah Spurrier



More information about the Python-list mailing list