[apparmor] [patch] convert test-regex_matches.py to new tests[] loop

Steve Beattie steve at nxnw.org
Tue Mar 31 20:15:22 UTC 2015


On Tue, Mar 31, 2015 at 03:00:51AM -0700, Steve Beattie wrote:
> On Fri, Mar 06, 2015 at 11:58:00PM +0100, Christian Boltz wrote:
> > Am Mittwoch, 4. März 2015 schrieb Christian Boltz:
> > > this patch converts test-regex_matches.py to the new tests[] loop.
> > > 
> > > Needless to say that this patch depends on 
> > >     [patch] add better loop support to common_test.py
> > > 
> > > The test behaviour is the same with and without this patch - 166 tests
> > > run, all successful.
> > > 
> > > BTW: I don't care too much for getting rid of
> > > setup_has_comma_testcases() and setup_split_comment_testcases() - the
> > > important point of this patch is to get rid of the list of test
> > > classes and the risk of forgetting to add new classes there.
> > > 
> > > Oh, just in case you wonder - some parts of this patch are
> > > hand-formatted ;-)
> > > 
> > > 
> > > As usual, I propose this patch for trunk and 2.9.
> > 
> > Here's v2 that includes the simplified setup_all_tests() syntax:
> 
> This suffers (unsurprisingly) from the same python2.7 problem as the
> 07-common_test_better_loop_support.diff patch does:
> 
>   $ PYTHONPATH=.. python2.7 ./test-regex_matches.py -v
>   Traceback (most recent call last):
>     File "./test-regex_matches.py", line 395, in <module>
>       setup_all_tests()
>     File "/home/steve/bzr/apparmor-master/utils/test/common_test.py", line 60, in setup_all_tests
>       obj_instance = obj() # will fail for (non-test) classes with additional __init__ parameters
>     File "/usr/lib/python2.7/unittest/case.py", line 189, in __init__
>       (self.__class__, methodName))
>   ValueError: no such test method in <class '__main__.AARegexBareFile'>: runTest
> 
> That said, I'm assuming the solution for the issue will land in
> common_test.py, so once 07-common_test_better_loop_support.diff is in
> good shape, this would be Acked-by: Steve Beattie <steve at nxnw.org>,
> too.

Alright, with the updated 07-common_test_better_loop_support.diff, this
still looks good (and passes make check).

Acked-by: Steve Beattie <steve at nxnw.org>

Thanks.

> > [ 08-convert-test-regex_matches.diff ]

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150331/2b2c1116/attachment.pgp>


More information about the AppArmor mailing list