<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 31, 2016 at 9:41 AM, Florian Bruhin <span dir="ltr">&lt;<a href="mailto:me@the-compiler.org" target="_blank">me@the-compiler.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* Dan Stromberg &lt;<a href="mailto:dstromberglists@gmail.com">dstromberglists@gmail.com</a>&gt; [2016-05-31 09:17:33 -0700]:<br>
<span class="">&gt; I&#39;m looking for a way of getting a condition coverage report for python<br>
&gt; code.<br>
&gt;<br>
&gt; We&#39;ve been using coverage.py .<br>
&gt;<br>
&gt; coverage.py appears to, at best, give branch coverage in its HTML report.<br>
&gt; However, it&#39;s beginning to look like coverage.py can give condition<br>
&gt; coverage (which is what we prefer). but only via its XML report.<br>
&gt;<br>
&gt; Is that accurate?<br>
<br>
</span>I don&#39;t think so.<br>
<br>
AFAIK there&#39;s a blogpost by Ned Batchelder about why he hasn&#39;t been<br>
able to implement this, but I can&#39;t find it right now...  <br></blockquote><div><br></div><div>I&#39;m puzzled by this:<br>$ egrep condition coverage.xml | head -5<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;24&quot; number=&quot;23&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;29&quot; number=&quot;28&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;99&quot; number=&quot;98&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;36&quot; number=&quot;14&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;100% (2/2)&quot; hits=&quot;1&quot; number=&quot;18&quot;/&gt;<br><br>$ rm coverage.xml<br><br>$ ./bin/jenkins-test &gt; /dev/null 2&gt;&amp;1<br><br>$ egrep condition coverage.xml | head -5<br>cmd output started 2016 Tue May 31 09:52:23 AM PDT<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;24&quot; number=&quot;23&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;29&quot; number=&quot;28&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;99&quot; number=&quot;98&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;50% (1/2)&quot; hits=&quot;1&quot; missing-branches=&quot;36&quot; number=&quot;14&quot;/&gt;<br>                                                &lt;line branch=&quot;true&quot; condition-coverage=&quot;100% (2/2)&quot; hits=&quot;1&quot; number=&quot;18&quot;/&gt;<br><br>./bin/jenkins-test is using nose with --with-coverage - so via the coverage.py plugin .<br><br></div><div>Note the presence of the string &quot;condition-coverage&quot;.<br><br>Also, coverage.py&#39;s xmlreport.py has:<br>                    xline.setAttribute(<br>                        &quot;condition-coverage&quot;,<br>                        &quot;%d%% (%d/%d)&quot; % (100*taken/total, taken, total)<br>                        )<br><br></div><div><br></div><div>Thanks!</div></div></div></div>