Maintaining a backported module

Oscar Benjamin oscar.j.benjamin at gmail.com
Fri Oct 25 03:49:43 EDT 2013


On Oct 24, 2013 9:38 PM, "Terry Reedy" <tjreedy at udel.edu> wrote:
>
> On 10/24/2013 1:46 PM, Ned Batchelder wrote:
>>>
>>> On Thu, 24 Oct 2013 06:36:04 -0400, Ned Batchelder wrote:
>>>>
>>>> coverage.py currently runs on 2.3 through 3.4
>
>
> I want to thank you for this package. I have used it when writing test
modules for idlelib modules and aiming for 100% coverage forces me to
really understand the code tested to hit all the conditional lines.
>
>
>> It's been fun dropping the contortions for coverage.py 4.x, though!
>
>
> One request: ignore "if __name__ == '__main__':" clauses at the end of
files, which cannot be run under coverage.py, so 100% coverage is reported
as 100% instead of 9x%.

Coverage already does this. You have to put it in your coveragerc.
Personally I arrange to ensure that I am testing that part though. You can
enable coverage for these with the pth file and the environment variable
whose name temporarily escapes me. Or you can just invoke coverage directly
on the script.

Oscar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131025/d6602901/attachment.html>


More information about the Python-list mailing list