<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D">I agree with you. Covering tests seems sensible. Sometimes, in a larger system, test names get duplicated resulting in the earlier test being ignored. Other times a simple typo results in the
 test framework ignoring a test altogether. As tests evolve, helper methods that were once used, get dropped and dead code results.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D">Actually I struggled with this a bit more and now have coverage on my tests as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D">Thanks for all the support.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"> testing-in-python-bounces@lists.idyll.org [mailto:testing-in-python-bounces@lists.idyll.org]
<b>On Behalf Of </b>Ned Batchelder<br>
<b>Sent:</b> Tuesday, September 16, 2014 3:45 AM<br>
<b>To:</b> testing-in-python@lists.idyll.org<br>
<b>Subject:</b> Re: [TIP] How do I get coverage on the test modules themselves?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">On 9/15/14 9:46 PM, Mcgregor, Cecil wrote:<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">I&#8217;m using coverage 3.7.1 with python 2.7.3 on Red Hat 4.1.2 linux</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">I&#8217;ve been attempting to get coverage on the test code themselves. So far coverage</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">seems to ignore these files. </span>
<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">It&#8217;s not obvious from the documentation how I can do this.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">How do I cover the test_*.py files as part of the coverage reports?</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;">Others have explained the &quot;don't cover your tests&quot; mindset.&nbsp; I like coverage-measuring my tests, for the simple reason that it gives me assurance that the tests are actually
 running.&nbsp; If you've ever copy-pasted a test to make a new similar test, but forgot to change the method name, you've had tests that don't run.&nbsp; Coverage can find those problems.<br>
<br>
You'll have to show us how you are running the tests.&nbsp; Coverage.py by default does not try to exclude test_*.py files.<br>
<br>
--Ned.<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">&nbsp;</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Thanks</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>testing-in-python mailing list<o:p></o:p></pre>
<pre><a href="mailto:testing-in-python@lists.idyll.org">testing-in-python@lists.idyll.org</a><o:p></o:p></pre>
<pre><a href="http://lists.idyll.org/listinfo/testing-in-python">http://lists.idyll.org/listinfo/testing-in-python</a><o:p></o:p></pre>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p>
</div>
</body>
</html>