<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div><div dir="ltr"><div style="background-color: rgb(255, 255, 255); "><font color="#2a2a2a" size="2"><span style="line-height: 17px;">We&nbsp;</span></font><font color="#2a2a2a"><span style="line-height: 17px;">currently</span></font><font color="#2a2a2a" size="2"><span style="line-height: 17px;">&nbsp;collect all the data coverage files and generate a combined report out of it and it is working fine</span></font></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">However I'm facing a problem. It is about the modules which are part of the coverage reports. I understand from the documentation that I should be able to omit certain modules and or libraries. I tried a lot the past week but am not succesful with it. Maybe you can help me with what I'm doing wrong.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">when I use the following code:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div>cov = coverage(data_file="UsefulTestResults/CoveragePython", config_file="config.coveragerc")</div></div><div><div>cov.use_cache(0)</div></div><div><div>cov.combine()</div></div><div><div>include=get_modules_to_report_from_coveragepy_config()</div></div><div><div>cov.html_report('C:\SVN\Shared\DevelopmentEhv\Products\MHServer\Trunk\Source\MHServer\core\\algorithms.pyc')</div></div><div><br></div></div><span style="color:rgb(42, 42, 42);line-height:17px;background-color:rgb(255, 255, 255)">OR:</span><br style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div><div>cov = coverage(data_file="UsefulTestResults/CoveragePython", config_file="config.coveragerc")</div></div></div><div><div><div>cov.use_cache(0)</div></div></div><div><div><div>cov.combine()</div></div></div><div><div><div>include=get_modules_to_report_from_coveragepy_config()</div></div></div><div><div><div>cov.html_report('testproduct3\Source\MHServer\core\\algorithms.pyc')</div></div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">both works, the name of the html file differs in both situation, I like the shortes one, I even prefer to get rid of testproduct3 in the last situation but it works</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">However when using the config file and call&nbsp;cov.html_report() I don't get it to work</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">when I add the following to my config file:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div><i>[run]</i></div></div><div><div><i>source =</i></div></div><div><div><i>&nbsp; &nbsp; testproduct3\Source\MHServer\core\\algorithms.pyc</i></div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">Then still everything is reported, so it looks like it doesn't use the source parameter</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">when I use the following in my config file</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div><i>[run]</i></div></div><div><div><i>include=</i></div></div><div><div><i>&nbsp; &nbsp; testproduct3\Source\MHServer\core\\algorithms.pyc</i></div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I get an exception:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div>Traceback (most recent call last):</div></div><div><div>&nbsp; File "combineReport.py", line 40, in &lt;module&gt;</div></div><div><div>&nbsp; &nbsp; cov.html_report()</div></div><div><div>&nbsp; File "C:\SVN\SandBox\coveragePython\CoveragePython\coverage\control.py", line 599, in html_report</div></div><div><div>&nbsp; &nbsp; reporter.report(morfs, config=self.config)</div></div><div><div>&nbsp; File "C:\SVN\SandBox\coveragePython\CoveragePython\coverage\html.py", line 83, in report</div></div><div><div>&nbsp; &nbsp; self.report_files(self.html_file, morfs, config, config.html_dir)</div></div><div><div>&nbsp; File "C:\SVN\SandBox\coveragePython\CoveragePython\coverage\report.py", line 78, in report_files</div></div><div><div>&nbsp; &nbsp; raise CoverageException("No data to report.")</div></div><div><div>coverage.misc.CoverageException: No data to report.</div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">Furthermore in the situation where I got 1 file to work, I had to give filenames, but I like to give module names. You can imagine that giving filenames is a lot of work. From the documentation I read that it should be possible to give module names but I didn't get that to work.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">In our situation we have a dir MHServer (package name??) with 4 modules (core ,fpimport, rest_ttx ,rest_generic)</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">So i would like to configure coverage.py to report everything inside MHServer, and if that isn't possible I can also give the 4 modules&nbsp;&nbsp;(core, fpimport, rest_ttx, rest_generic).</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I also tried to ommit modules and files but I wasn't succesful either. for example we use Django which ends up in the reports.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div>cov.html_report(omit='C:\SVN\Shared\DevelopmentEhv\Products\MHServer\Trunk\\Libs\\Django\\lib\\django\\conf\\__init__.py')</div><div>cov.html_report(omit='testproduct3\\Libs\\Django\\lib\\django\\conf\\__init__.py')</div><div>cov.html_report(omit='django')</div><div>cov.html_report(omit='\Libs\\Django\\lib\\django\\*')</div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">but none where excluding items from the report</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">Another strange thing:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I tried:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">cov.html_report('testproduct3\\Source\\MHServer\\core\\*')</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">that gives files directly located in that directory so that's good, But I also want reports from files located in the subdirs.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">When I remove:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div>[report]</div></div><div><div>ignore_errors = true&nbsp;</div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I get the followin message:</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255);padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none"><div><div>coverage.misc.NoSource: No source for code: 'c:\\svn\\sandbox\\coveragepython\\testproduct3\\source\\mhserver\\core\\assetmanagement': [Errno 13] Permission denied: 'c:\\svn\\sandbox\\coveragepython\\testproduct3\\source\\mhserver\\core\\assetmanagement'</div></div></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I don't get why I get that message.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">I hope you understand my problem/question and you can help me with it.</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)"><br></div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">Regards,</div><div style="line-height:17px;color:rgb(42, 42, 42);background-color:rgb(255, 255, 255)">Mark</div>                                               </div></div>                                               </div></body>
</html>