[PEAK] Conflict between PEAK and coverage.py

Bobby Impollonia bobbyi at gmail.com
Tue Mar 22 17:13:06 EDT 2011


On Fri, Mar 18, 2011 at 11:59 AM, P.J. Eby <pje at telecommunity.com> wrote:
> The real error here is occurring earlier, when make_decorator isn't getting
> made into a classmethod.

Thanks for explanation. You are right as I can recreate the problem
without Peak Rules using the following test program:
from peak.util.decorators import decorate

class MyClass(object):
    decorate(classmethod)
    def myclassmethod(cls):
        return cls.__name__

if __name__ == '__main__':
    print MyClass().myclassmethod() # throws exception under coverage

> So, it would appear that something in coverage's
> trace function is disabling DecoratorTools' trace function, or at any rate
> stopping it from getting called.

So is this likely a bug in coverage?

> Have you tried the --timid option?  Coverage's internal docs suggest that
> this is required when working with DecoratorTools.

It works correctly with --timid. It's somewhat inconvenient because it
makes the tests run several times slower and nose's coverage plugin
doesn't expose that option.


More information about the PEAK mailing list