diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-01-20 21:29:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-11 17:40:08 +0000 |
commit | f30d619a63f19bc48196680586fa9f70df4c0512 (patch) | |
tree | 5177f8508bb8dbb026a4c5b39c3547dce25b2358 /meta/lib | |
parent | 2f598a83180e16cdc005679c0a730b5620df1a19 (diff) | |
download | poky-f30d619a63f19bc48196680586fa9f70df4c0512.tar.gz |
oeqa/utils/decorators: Try and improve ugly _ErrorHandler tracebacks
Currently, if one module is skipped, any other module calling skipModule
causes tracebacks about _ErrorHandler not having a _testMethodName
method.
This reworks the code in a way to avoid some of the problems by using
the id() method of the objects. It also maps to the correct name
format rather than "setupModule" or just skiping the item entirely.
(From OE-Core rev: 78d3bf2e4c88779df32b9dfbe8362dc24e9ad080)
(From OE-Core rev: 4019ae1dc223a5ec925e49fb9c3ad33ce170cbab)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/utils/decorators.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py index 7f845dbb4b..40bd4ef2db 100644 --- a/meta/lib/oeqa/utils/decorators.py +++ b/meta/lib/oeqa/utils/decorators.py | |||
@@ -18,14 +18,21 @@ class getResults(object): | |||
18 | upperf = sys._current_frames().values()[0] | 18 | upperf = sys._current_frames().values()[0] |
19 | while (upperf.f_globals['__name__'] != 'unittest.case'): | 19 | while (upperf.f_globals['__name__'] != 'unittest.case'): |
20 | upperf = upperf.f_back | 20 | upperf = upperf.f_back |
21 | self.faillist = [ seq[0]._testMethodName for seq in upperf.f_locals['result'].failures ] | 21 | |
22 | self.errorlist = [ seq[0]._testMethodName for seq in upperf.f_locals['result'].errors ] | 22 | def handleList(items): |
23 | #ignore the _ErrorHolder objects from the skipped tests list | 23 | ret = [] |
24 | self.skiplist = [] | 24 | # items is a list of tuples, (test, failure) or (_ErrorHandler(), Exception()) |
25 | for seq in upperf.f_locals['result'].skipped: | 25 | for i in items: |
26 | try: | 26 | s = i[0].id() |
27 | self.skiplist.append(seq[0]._testMethodName) | 27 | #Handle the _ErrorHolder objects from skipModule failures |
28 | except: pass | 28 | if "setUpModule (" in s: |
29 | ret.append(s.replace("setUpModule (", "").replace(")","")) | ||
30 | else: | ||
31 | ret.append(s) | ||
32 | return ret | ||
33 | self.faillist = handleList(upperf.f_locals['result'].failures) | ||
34 | self.errorlist = handleList(upperf.f_locals['result'].errors) | ||
35 | self.skiplist = handleList(upperf.f_locals['result'].skipped) | ||
29 | 36 | ||
30 | def getFailList(self): | 37 | def getFailList(self): |
31 | return self.faillist | 38 | return self.faillist |