On Wed, Mar 25, 2009 at 11:25 AM, zpcspm <[email protected]> wrote:

>
> E0602: 10: Undefined variable 'self'
>
> I'm not quoting the context here, because I think I will be able to
> explain the problem without it. Here 'self' is that 'self' that was
> added to leo's unit testing framework, that one I've mentioned above.
> This 'self' makes sense when the code inside @test nodes is being run
> by leo. But it confuses pylint when I'm running it against the derived
> file.
>
> Any hints?


I guess the *nix way would be to pipe the output of pylint to a filter that
ignores the E0602 lines involving self :-)

I don't see an obvious way of telling pylint that code snippets are part of
@test nodes.

BTW, doesn't pylint also complain about undefined g and p vars?

In general, the most general solution to these kinds of context problems
would be to write preprocessing and post-processing scripts.  The
preprocessing script might wrap the contents of an @test node in a subclass
of unitTest.testCase.  Maybe that subclass could define g and p as class
vars.  Or something.  The pre-processing script would create one or more
files.  You would run pylint on those files.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to