[apparmor] [patch] utils: make test-severity pyflakes compliant

Christian Boltz apparmor at cboltz.de
Fri Nov 14 23:04:14 UTC 2014


Hello,

Am Freitag, 14. November 2014 schrieb Steve Beattie:
> On Thu, Nov 13, 2014 at 06:19:57PM +0100, Christian Boltz wrote:
> > That said - we have "make check" and "make test". Maybe we should
> > merge them into one target so that one command will check
> > everything.
> > 
> > Hmm, maybe using
> > 
> >     test: check
> > 
> > in the Makefile would already improve the situation.
> 
> Err, I don't see that anywhere in the utils/ tree.

Argh, you are right - probably all the test-*.py confused me ;-)

However we have the pyflakes call in utils/Makefile and run the tests 
from utils/test/Makefile - that's the split I meant. Looks like I should 
start to run "make check" in utils instead of utils/test ;-)

> > > I'd inadvertently created two test cases with the same method
> > > name,
> > > so only one test case would actually be used.
> > 
> > That's the problem with copy&paste-programming ;-)
> 
> Tis' true. Though you'll note that pyflakes can catch some stuff like
> this. And I've also seen people have autogenerated test methods under
> pyunit that ended up with name collisions and thus not have as many
> tests actually executed as expected. And it makes for more difficult
> test isolation for debugging failures. So there's trade offs.

Autogenerated tests with name collisions are an issue on its own ;-)

Besides that, I'm a bit surprised that python doesn't print a warning 
like "function foo already defined" - PHP does this, and I find it quite 
useful ;-)


Regards,

Christian Boltz
-- 
Das hat wie so vieles im Leben Vor- und Nachteile. Es ist halt alles
andere als DAU-sicher. Aber da nur ich hier rumfuhrwerke brauche ich
nicht lange nach dem Verursacher suchen, falls etwas schiefgeht. Ein
Blick in den Spiegel reicht vollkommen... [Ralph Müller in suse-linux]




More information about the AppArmor mailing list