[TIP] problems w/ coverage and threads?
dpranke at chromium.org
Tue Aug 24 11:36:42 PDT 2010
I'm running the following program under coverage on a Mac Pro running
Snow Loepard (using "coverage run threads_unittest.py", python 2.5,
coverage 3.3.1) and getting no coverage numbers from the
method. Also, if I try to mark it ignored with "# pragma: no cover",
that seems to have no effect.
I would have thought that both of these things would work. Any ideas?
% cat threads_unittest.py
def __init__(self, started_queue, stopping_queue):
self._started_queue = started_queue
self._stopping_queue = stopping_queue
print "starting thread"
msg = self._stopping_queue.get()
print "exiting thread"
starting_queue = Queue.Queue()
stopping_queue = Queue.Queue()
thd = TestThread(starting_queue, stopping_queue)
if __name__ == '__main__':
More information about the testing-in-python