<div dir="ltr">Hi,<div><br></div><div>So I&#39;m using coverage.py API</div><div><pre style="box-sizing:border-box;font-family:consolas,&quot;andale mono wt&quot;,&quot;andale mono&quot;,&quot;lucida console&quot;,&quot;lucida sans typewriter&quot;,&quot;dejavu sans mono&quot;,&quot;bitstream vera sans mono&quot;,&quot;liberation mono&quot;,&quot;nimbus mono l&quot;,monaco,&quot;courier new&quot;,courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;padding:12px;line-height:1.5;overflow:auto;color:rgb(64,64,64)"><span class="gmail-kn" style="box-sizing:border-box">import</span> <span class="gmail-nn" style="box-sizing:border-box;color:rgb(85,85,85)">coverage</span>

<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span> <span class="gmail-o" style="box-sizing:border-box;font-weight:bold">=</span> <span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">coverage</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">Coverage</span><span class="gmail-p" style="box-sizing:border-box">()</span>
<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">start</span><span class="gmail-p" style="box-sizing:border-box">()</span>

<span class="gmail-c1" style="box-sizing:border-box;color:rgb(153,153,136);font-style:italic"># .. call your code ..</span>

<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">stop</span><span class="gmail-p" style="box-sizing:border-box">()</span>
<span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">cov</span><span class="gmail-o" style="box-sizing:border-box;font-weight:bold">.</span><span class="gmail-n" style="box-sizing:border-box;color:rgb(51,51,51)">save</span><span class="gmail-p" style="box-sizing:border-box">()</span></pre></div><div><br></div><div>The main thread creates a coverage instance and starts it.</div><div>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.</div><div>Problem is that tracing is stopped after I do that. I guess it&#39;s because I start it from another thread.</div><div><br></div><div>Is there a way I can reset/restart coverage from another thread or manually clear coverage data?</div><div><br></div><div>Thanks</div><div><br></div></div>