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/standard/, pmstestsuite/library/, pmstestsuite/
Date: Wed, 03 Aug 2011 20:17:39
Message-Id: 417cc44cec713c41b91ee19281b8f13b88a931e7.mgorny@gentoo
1 commit: 417cc44cec713c41b91ee19281b8f13b88a931e7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 3 20:02:32 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 3 20:02:32 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=417cc44c
7
8 Drop bool return in check_results() backwards compat.
9
10 ---
11 pmstestsuite/cli.py | 18 +++++-------------
12 pmstestsuite/library/case.py | 1 -
13 pmstestsuite/library/depend_case.py | 10 ++++------
14 pmstestsuite/library/standard/dbus_case.py | 14 +++++++-------
15 4 files changed, 16 insertions(+), 27 deletions(-)
16
17 diff --git a/pmstestsuite/cli.py b/pmstestsuite/cli.py
18 index 155dc2c..f21c7a9 100644
19 --- a/pmstestsuite/cli.py
20 +++ b/pmstestsuite/cli.py
21 @@ -129,21 +129,13 @@ class PMSTestSuiteCLI(object):
22 self.failed = []
23 for t in self.test_library:
24 try:
25 - res = t.check_result(self.pm)
26 - except AssertionError:
27 - res = False
28 - outc = 'F'
29 - except Exception:
30 - res = False
31 - outc = 'E'
32 - # XXX: store exception details somewhere
33 + t.check_result(self.pm)
34 + except Exception as e:
35 + outc = 'F' if isinstance(e, AssertionError) else 'E'
36 + self.failed.append(t)
37 + # XXX: store exception details somewhere?
38 else:
39 outc = '.'
40 - # forward compat
41 - if res is None:
42 - res = True
43 - if not res:
44 - self.failed.append(t)
45 t.clean(self.pm)
46 print(outc, end='')
47 print('')
48
49 diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py
50 index 9ff757a..6b74fc6 100644
51 --- a/pmstestsuite/library/case.py
52 +++ b/pmstestsuite/library/case.py
53 @@ -480,4 +480,3 @@ class EbuildTestCase(TestCase):
54 merged = self.atom(pm) in pm.installed
55 self.assertBool(not self.expect_failure, merged,
56 'package merged')
57 - return True
58
59 diff --git a/pmstestsuite/library/depend_case.py b/pmstestsuite/library/depend_case.py
60 index f5f7327..793d7ce 100644
61 --- a/pmstestsuite/library/depend_case.py
62 +++ b/pmstestsuite/library/depend_case.py
63 @@ -66,10 +66,9 @@ class EbuildDependencyTestCase(EbuildTestCase):
64 return of
65
66 def check_result(self, pm):
67 - res = EbuildTestCase.check_result(self, pm)
68 + EbuildTestCase.check_result(self, pm)
69 for o in self.dependant_ebuilds:
70 - res &= o.check_result(pm)
71 - return res
72 + o.check_result(pm)
73
74 class EclassDependencyTestCase(EclassTestCase, EbuildDependencyTestCase):
75 """
76 @@ -151,7 +150,6 @@ class EclassDependencyTestCase(EclassTestCase, EbuildDependencyTestCase):
77 return of
78
79 def check_result(self, pm):
80 - res = EclassTestCase.check_result(self, pm)
81 + EclassTestCase.check_result(self, pm)
82 for o in self.dependant_ebuilds:
83 - res &= o.check_result(pm)
84 - return res
85 + o.check_result(pm)
86
87 diff --git a/pmstestsuite/library/standard/dbus_case.py b/pmstestsuite/library/standard/dbus_case.py
88 index e0cd09c..97462fb 100644
89 --- a/pmstestsuite/library/standard/dbus_case.py
90 +++ b/pmstestsuite/library/standard/dbus_case.py
91 @@ -104,7 +104,7 @@ class DBusBaseTestCase(object):
92
93 def check_result(self, pm):
94 self.assertTrue(self.dbus_started, 'build started')
95 - return self.check_dbus_result(self.dbus_output, pm)
96 + self.check_dbus_result(self.dbus_output, pm)
97
98 class DBusEbuildTestCase(DBusBaseTestCase, EbuildTestCase):
99 """ D-Bus capable base test case. """
100 @@ -115,7 +115,7 @@ class DBusEbuildTestCase(DBusBaseTestCase, EbuildTestCase):
101 DBusBaseTestCase.__init__(self)
102
103 def check_dbus_result(self, output, pm):
104 - return EbuildTestCase.check_result(self, pm)
105 + EbuildTestCase.check_result(self, pm)
106
107 class DBusEclassTestCase(DBusBaseTestCase, EclassTestCase):
108 """ D-Bus capable eclass test case. """
109 @@ -126,7 +126,7 @@ class DBusEclassTestCase(DBusBaseTestCase, EclassTestCase):
110 DBusBaseTestCase.__init__(self)
111
112 def check_dbus_result(self, output, pm):
113 - return EclassTestCase.check_result(self, pm)
114 + EclassTestCase.check_result(self, pm)
115
116 class DBusEbuildDependencyTestCase(DBusBaseTestCase, EbuildDependencyTestCase):
117 """ D-Bus capable dependency test case. """
118 @@ -137,12 +137,12 @@ class DBusEbuildDependencyTestCase(DBusBaseTestCase, EbuildDependencyTestCase):
119 DBusBaseTestCase.__init__(self)
120
121 def check_dbus_result(self, output, pm):
122 - return EbuildDependencyTestCase.check_result(self, pm)
123 + EbuildDependencyTestCase.check_result(self, pm)
124
125 def check_result(self, pm):
126 self.assertBool(not self.expect_failure, self.dbus_started,
127 'build started')
128 - return self.check_dbus_result(self.dbus_output, pm)
129 + self.check_dbus_result(self.dbus_output, pm)
130
131 class DBusEclassDependencyTestCase(DBusBaseTestCase, EclassDependencyTestCase):
132 """ D-Bus capable eclass dependency test case. """
133 @@ -153,9 +153,9 @@ class DBusEclassDependencyTestCase(DBusBaseTestCase, EclassDependencyTestCase):
134 DBusBaseTestCase.__init__(self)
135
136 def check_dbus_result(self, output, pm):
137 - return EclassDependencyTestCase.check_result(self, pm)
138 + EclassDependencyTestCase.check_result(self, pm)
139
140 def check_result(self, pm):
141 self.assertBool(not self.expect_failure, self.dbus_started,
142 'build started')
143 - return self.check_dbus_result(self.dbus_output, pm)
144 + self.check_dbus_result(self.dbus_output, pm)