Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/
Date: Wed, 29 Jun 2011 17:53:07
Message-Id: f35a14a1d1f8cc7e2b79fdb3ae3054f038e9d407.mgorny@gentoo
1 commit: f35a14a1d1f8cc7e2b79fdb3ae3054f038e9d407
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 29 17:46:51 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 17:46:51 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=f35a14a1
7
8 Actually support the thorough mode.
9
10 ---
11 pmstestsuite/library/__init__.py | 2 +-
12 pmstestsuite/library/case.py | 14 +++++++++-----
13 2 files changed, 10 insertions(+), 6 deletions(-)
14
15 diff --git a/pmstestsuite/library/__init__.py b/pmstestsuite/library/__init__.py
16 index 6499e3f..d65958f 100644
17 --- a/pmstestsuite/library/__init__.py
18 +++ b/pmstestsuite/library/__init__.py
19 @@ -48,7 +48,7 @@ class TestLibrary(object):
20 modname = '%s.%s' % (self.modname, modname)
21 mod = __import__(modname, {}, {}, [clsname], 0)
22 cls = getattr(mod, clsname)
23 - for i in cls.inst_all():
24 + for i in cls.inst_all(thorough = self.thorough):
25 self.tests.append(i)
26 yield i
27
28
29 diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py
30 index 3eba089..3327c33 100644
31 --- a/pmstestsuite/library/case.py
32 +++ b/pmstestsuite/library/case.py
33 @@ -149,16 +149,20 @@ class EbuildTestCase(TestCase):
34 return (random.choice(cls._eval_prop(cls.supported_eapis)),)
35
36 @classmethod
37 - def inst_all(cls):
38 + def inst_all(cls, thorough = False):
39 """
40 - Instantiate the test case for all relevant EAPIs.
41 + Instantiate the test case for all relevant EAPIs. If in thorough
42 + mode, assume all supported EAPIs are relevant.
43
44 Returns an iterator over a list of test case instances.
45 """
46
47 - # sadly, no @classproperty
48 - # but property object attributes are official
49 - for eapi in cls._eval_prop(cls.relevant_eapis):
50 + if thorough:
51 + eapis = cls.supported_eapis
52 + else:
53 + eapis = cls.relevant_eapis
54 +
55 + for eapi in cls._eval_prop(eapis):
56 yield cls(eapi = eapi)
57
58 @property