[apparmor] [patch] simplify setup_all_tests() call in utils test
Christian Boltz
apparmor at cboltz.de
Fri Mar 6 22:56:24 UTC 2015
Hello,
Am Donnerstag, 5. März 2015 schrieb Christian Boltz:
> Am Mittwoch, 4. März 2015 schrieb Seth Arnold:
> > On Thu, Mar 05, 2015 at 01:22:47AM +0100, Christian Boltz wrote:
> > > BTW: If I had noticed earlier that __name__ is always '__main__',
> > > I'd have implemented the simplified way from the beginning.
> >
> > But is it always __main__? The whole point of the guard is that the
> > files may be called in multiple ways and with different tools,
> > perhaps including test runners that do different things...
>
> Well, if __name__ is not '__main__' for some reason [1], the if
> condition won't match and the function won't be called. (In this case,
> unittest.main() also won't be called.)
>
> So _if_ the function is called, it _is_ always '__main__' ;-)
No more complaints? Nice :-)
Since I had to do a fix in setup_all_tests() anyway, I decided to
include this patch there.
This means: forget 12-test-loop-simplify.diff - it's now included in
07-common_test_better_loop_support.diff and a little part of it goes
into 08-convert-test-regex_matches.diff.
Regards,
Christian Boltz
--
<coolo> waiting for packages is more fun with OBS than with DHL :)
[from #opensuse-project]
More information about the AppArmor
mailing list