[TIP] [coverage] anyway to omit modules rather than files?

Ned Batchelder ned at nedbatchelder.com
Wed Jan 25 13:11:14 PST 2012


On 1/25/2012 1:23 PM, Chris Withers wrote:
> Hi Ned,
>
> On 25/01/2012 14:39, Ned Batchelder wrote:
>>> Is there any way to specify modules to omit rather than files?
>>> Figuring out the filespec and worrying about cross-platform specs
>>> would then go away...
>>>
>> Right now, only filename patterns are accepted for omit and include.
>> Have you used "source"? It seems to do what people want most.
>
> Unless I'm missing something, if I do:
>
> source=testfixtures
>
> ...that will also include testfixtures.tests, which contains my unit 
> tests, and which I don't want covered.
>
True, it will include testfixtures.tests.  I always prefer to cover the 
tests also: occasionally something useful is discovered, like two tests 
with the same name, so one doesn't run.  But I understand not everyone 
wants that.

--Ned.
> cheers,
>
> Chris
>



More information about the testing-in-python mailing list