[TIP] Resetting or Restarting coverage.py trace

Shai Cantor shai at sealights.io
Sat Oct 15 23:36:42 PDT 2016


Hi,

So I'm using coverage.py API

import coverage
cov = coverage.Coverage()cov.start()
# .. call your code ..
cov.stop()cov.save()


The main thread creates a coverage instance and starts it.
During the lifetime of the program I have multiple threads and I need every
once in while to reset or restart the coverage process (or clear coverage
data) from one of the underlying threads.
Problem is that tracing is stopped after I do that. I guess it's because I
start it from another thread.

Is there a way I can reset/restart coverage from another thread or manually
clear coverage data?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20161016/274df547/attachment.htm>


More information about the testing-in-python mailing list