<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Doug, thanks for reporting this.&nbsp; If you don't get a toy TG project
working, here are two things to try:<br>
<br>
1) Try running coverage with the -L switch to include tracing the std
lib.&nbsp; This is just to see if the stdlib-exclusion code is at fault.<br>
<br>
2) If you can pull the latest code from bitbucket
(<a class="moz-txt-link-freetext" href="http://bitbucket.org/ned/coveragepy/get/tip.gz">http://bitbucket.org/ned/coveragepy/get/tip.gz</a>), there's commented-out
logging of the decision of what to trace and what not to.
At line 123 of control.py is an "if 0:".&nbsp; Change it to "if 1:", then
run coverage.&nbsp; You'll get a line for each source file considered,
showing the decision of whether to trace it or not.&nbsp; If you don't mind
showing the filenames of your code, that log could be
helpful in understanding what's going on here.<br>
<br>
--Ned.<br>
<a class="moz-txt-link-freetext" href="http://nedbatchelder.com">http://nedbatchelder.com</a><br>
<br>
Doug Latornell wrote:
<blockquote
 cite="mid:6279c0a40907151625w5333db60vd542d1bf224511b3@mail.gmail.com"
 type="cite"><span style="font-family: times new roman,serif;">I'm
having a similar problem running coverage 3.0.1 on a Turbogears 1.05
project.</span><br style="font-family: times new roman,serif;">
  <br style="font-family: times new roman,serif;">
  <span style="font-family: times new roman,serif;">Initially I had
nose 0.10.3 and coverage 3.0.1 and got a coverage report like this:</span><br>
  <br>
  <span style="font-family: courier new,monospace;">Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;Stmts &nbsp; Exec &nbsp;Cover &nbsp; Missing</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">-----------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp;1 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.config &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp; &nbsp;1 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.controllers
&nbsp; &nbsp; &nbsp; &nbsp;409 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 38-853</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.graphs &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; 353 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 13-527</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.init_database
&nbsp; &nbsp; &nbsp; 91 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 10-274</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.logs &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;23 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 9-55</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.model &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;298 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 2-794</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.release &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 2-41</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.scheduled_jobs
&nbsp; &nbsp; 259 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 9-555</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.templates &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp;1 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.utils &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 38 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 15-80</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.widgets &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 99 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; 0% &nbsp; 2-308</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">-----------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">TOTAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;1580 &nbsp; &nbsp; &nbsp;3 &nbsp; &nbsp; 0%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">Ran 109 tests in
85.575s</span><br style="font-family: courier new,monospace;">
  <br>
Upgraded nose to 0.11.1 and got the same result. &nbsp;Downgraded coverage
to 2.85 and got:<br>
  <br>
  <span style="font-family: courier new,monospace;">Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;Stmts &nbsp; Exec &nbsp;Cover &nbsp; Missing</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">-----------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.config &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp;0 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.controllers
&nbsp; &nbsp; &nbsp; &nbsp;378 &nbsp; &nbsp;260 &nbsp; &nbsp;68% &nbsp; 81, 93-94, 112-125, 137-166, 222, 258-306,
369, 374-375, 497-512, 535-553, 662-665, 685-709, 789</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.graphs &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; 353 &nbsp; &nbsp;296 &nbsp; &nbsp;83% &nbsp; 38-40, 42-44, 46-48, 51-53, 59-86, 129-131,
145-147, 215-217, 292-294, 302-304, 312-314, 322-324, 332-334, 443-445,
447, 460-462, 477-479</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.init_database
&nbsp; &nbsp; &nbsp; 91 &nbsp; &nbsp; 86 &nbsp; &nbsp;94% &nbsp; 267-274</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.logs &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;23 &nbsp; &nbsp; 23 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.model &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;297 &nbsp; &nbsp;287 &nbsp; &nbsp;96% &nbsp; 99-102, 113, 443-444, 448-449, 546</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.release &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6 &nbsp; &nbsp; &nbsp;6 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.scheduled_jobs
&nbsp; &nbsp; 259 &nbsp; &nbsp; 75 &nbsp; &nbsp;28% &nbsp; 66-225, 235-261, 269-272, 279-281, 288-394,
402-429, 538-555</span><br style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.templates &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;0 &nbsp; 100%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.utils &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 38 &nbsp; &nbsp; 28 &nbsp; &nbsp;73% &nbsp; 41-49, 59, 62-67</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">zemiva.widgets &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; 98 &nbsp; &nbsp; 95 &nbsp; &nbsp;96% &nbsp; 119, 131, 189</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">-----------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">TOTAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;1543 &nbsp; 1156 &nbsp; &nbsp;74%</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">Ran 109 tests in
470.762s</span><br>
  <br>
  <span style="font-family: times new roman,serif;">I created at toy
project and got a sane result with nose 0.11.1 and coverage 3.0.1:</span><br>
  <br>
  <span style="font-family: courier new,monospace;">Name &nbsp; &nbsp; &nbsp;Stmts &nbsp;
Exec &nbsp;Cover &nbsp; Missing</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">---------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">bar &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1 &nbsp; &nbsp;
&nbsp;1 &nbsp; 100%</span><br style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">bar.baz &nbsp; &nbsp; &nbsp; 4 &nbsp; &nbsp;
&nbsp;3 &nbsp; &nbsp;75% &nbsp; 6</span><br style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">foo &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 3 &nbsp; &nbsp;
&nbsp;3 &nbsp; 100%</span><br style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">---------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">TOTAL &nbsp; &nbsp; &nbsp; &nbsp; 8 &nbsp; &nbsp;
&nbsp;7 &nbsp; &nbsp;87%</span><br style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">----------------------------------------------------------------------</span><br
 style="font-family: courier new,monospace;">
  <span style="font-family: courier new,monospace;">Ran 2 tests in
0.020s</span><br>
  <br>
  <span style="font-family: times new roman,serif;">So, it looks like
the problem arises from something the in the Turbogears project, not
coverage or nose+coverage.&nbsp; I'll try to create a toy TG project to see
if I can reproduce the problem there.<br>
  <br>
Any suggestions are welcome.<br>
  <br>
Doug<br>
  </span><br>
On Thu, Jul 9, 2009 at 2:02 PM, Ned Batchelder &lt;<a
 moz-do-not-send="true" href="mailto:ned@nedbatchelder.com">ned@nedbatchelder.com</a>&gt;
wrote:<br>
&gt;<br>
&gt; Oh, and if this is the stackoverflow question you meant:<br>
&gt; <a moz-do-not-send="true"
 href="http://stackoverflow.com/questions/931248/coverage-not-showing-executed-lines-in-virtualenv">http://stackoverflow.com/questions/931248/coverage-not-showing-executed-lines-in-virtualenv</a><br>
&gt; , that problem was fixed in 3.0. &nbsp;Maybe there's more to it than I
know...<br>
&gt;<br>
&gt; --Ned.<br>
&gt; <a moz-do-not-send="true" href="http://nedbatchelder.com">http://nedbatchelder.com</a><br>
&gt;<br>
&gt; Matthew Wilson wrote:<br>
&gt; &gt; I just upgraded to the 3.0.1 version of coverage. &nbsp;Then I ran
this<br>
&gt; &gt; command to test some of my code:<br>
&gt; &gt;<br>
&gt; &gt; $ nosetests --with-coverage --cover-package
bazman.shiftcontrollers<br>
&gt; &gt; bazman/tests/controller_tests/test_shifttemplatecontrollers.py<br>
&gt; &gt;<br>
&gt; &gt; And the output showed ZERO lines covered. &nbsp;So then I found a
comment<br>
&gt; &gt; at stackoverflow saying that somebody went back to the old
version,<br>
&gt; &gt; and all was well. &nbsp;So I did that, and sure enough, I saw my
coverage<br>
&gt; &gt; again.<br>
&gt; &gt;<br>
&gt; &gt; I'll happily provide more details.<br>
&gt; &gt;<br>
&gt; &gt; Matt<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt; --<br>
&gt; Ned Batchelder, <a moz-do-not-send="true"
 href="http://nedbatchelder.com">http://nedbatchelder.com</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; testing-in-python mailing list<br>
&gt; <a moz-do-not-send="true"
 href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><br>
&gt; <a moz-do-not-send="true"
 href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a><br>
  <br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">-- 
Ned Batchelder, <a class="moz-txt-link-freetext" href="http://nedbatchelder.com">http://nedbatchelder.com</a>
</pre>
</body>
</html>