Re: Conflict between PEAK and coverage.py

Bobby Impollonia <[email protected]> Tue, 22 Mar 2011 14:13:06 -0700
Newsgroups gmane.comp.python.peak
Message-ID <[email protected]>
On Fri, Mar 18, 2011 at 11:59 AM, P.J. Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> 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.