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

Sylvain Thénault sylvain.thenault at logilab.fr
Thu Jul 12 00:39:10 PDT 2012


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).

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (09.54.03.55.76)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the testing-in-python mailing list