Forgot to reply to all..
---------- Forwarded message ----------
From:
Arve Knudsen <arve.k...@gmail.com>
Date: Sat, Sep 18, 2010 at 8:12 PM
Subject: Re: Coverage's xml command fails upon missing sources
To: Ned Batchelder <
n...@nedbatchelder.com>
But the handling *is* different, what is common is the raising of NoSource, reacting to it is different. As an example, if I run 'coverage report' in a project of mine, it says within the report:
/private/var/folders/0z/0z0neyduEeu0BDrqWi37zE+++TI/-Tmp-/tmp9xwDiA NoSource: No source for code: '/Users/arve/Projects/SrlLib/Tests/tmp9xwDiA.py'
However, if I run 'coverage xml', I get the message 'No source for code: '/Users/arve/Projects/SrlLib/Tests/tmp9xwDiA.py'' and the report (coverage.xml) is empty.
When it comes to my fix, I would say I did in fact introduce it in the right place (report.py as opposed to xmlreport.py). The reason being that the function report_files iterates over each code unit; if the exception isn't caught there, it will abort the report! The SummaryReporter isn't affected by this issue in report_files, since it doesn't use it. If there's going to be a standard way to report missing source files, there should also be a common implementation (for now, in report.py?).
I want to leave out the temp files yes, I don't even know how they get in there. But... that's a different issue, probably due to something my testsuite is doing, let's stick to the one at hand :)
Arve