[TIP] Pylint error with pytest function/method lever marker - class level marker works

Baiju M baiju.m.mail at gmail.com
Thu Jul 12 00:51:29 PDT 2012


Hi,

On Thu, Jul 12, 2012 at 1:09 PM, Sylvain Thénault
<sylvain.thenault at logilab.fr> wrote:
>
> Hi there,
>
> > On Wed, Jul 11, 2012 at 22:41 +0530, Baiju M wrote:
> > > When I use a function or method lever marker, pylint is throwing this error:
> > >
> > > $ pylint test_hello.py
> > > No config file found, using default configuration
> > > ************* Module test_hello
> > > C:  1,0: Missing docstring
> > > Traceback (most recent call last):
> > >   File "/home/baiju/pylintve/bin/pylint", line 4, in <module>
> > >     lint.Run(sys.argv[1:])
> > >   File "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/lint.py",
> > > line 879, in __init__
> > >     linter.check(args)
> > >   File "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/lint.py",
> > > line 502, in check
> > >     self.check_astng_module(astng, walker, rawcheckers)
> > >   File "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/lint.py",
> > > line 574, in check_astng_module
> > >     walker.walk(astng)
> > >   File "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/utils.py",
> > > line 528, in walk
> > >     self.walk(child)
> > >   File "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/utils.py",
> > > line 525, in walk
> > >     cb(astng)
> > >   File
> > > "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/checkers/base.py",
> > > line 161, in visit_function
> > >     if not redefined_by_decorator(node):
> > >   File
> > > "/home/baiju/pylintve/lib/python2.6/site-packages/pylint/checkers/base.py",
> > > line 116, in redefined_by_decorator
> > >     decorator.expr.name == node.name):
> > > AttributeError: 'Getattr' object has no attribute 'name'
>
> The crash is a pylint related pb which has already been fixed in recent
> version (latest is 0.25.1, though new release should occur in the next
> few days).


I tried from source (http://hg.logilab.org/pylint) and it worked!

Thanks for the fix, looking forward to the new release.

Regards,
Baiju M



More information about the testing-in-python mailing list