diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2019-06-14 14:32:18 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-14 22:48:22 +0100 |
commit | d9b0adbce87293be1fa2db39c3b09076477e9990 (patch) | |
tree | ada68317e4bd874755aa17c11ef1b15040980e7c /meta/lib | |
parent | e32d7565a3390d74bf6eff587f26613540f3d88b (diff) | |
download | poky-d9b0adbce87293be1fa2db39c3b09076477e9990.tar.gz |
oescripts.py: avoid error when cairo module is not available
When running 'oe-selftest -r oescripts', the following error appeared.
cls.skipTest('Python module cairo is not present')
TypeError: skipTest() missing 1 required positional argument: 'reason'
This is because the host does not have the cairo python module installed.
Fix this problem by using unittest's SkipTest exception.
(From OE-Core rev: 785bb108ceb9dc137ec8d75d887b6a3869cbfb9c)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/oescripts.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py index 217afe3775..7770b66a26 100644 --- a/meta/lib/oeqa/selftest/cases/oescripts.py +++ b/meta/lib/oeqa/selftest/cases/oescripts.py | |||
@@ -3,6 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | import os | 5 | import os |
6 | import unittest | ||
6 | from oeqa.selftest.case import OESelftestTestCase | 7 | from oeqa.selftest.case import OESelftestTestCase |
7 | from oeqa.selftest.cases.buildhistory import BuildhistoryBase | 8 | from oeqa.selftest.cases.buildhistory import BuildhistoryBase |
8 | from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer | 9 | from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer |
@@ -38,7 +39,7 @@ class OEScriptTests(OESelftestTestCase): | |||
38 | try: | 39 | try: |
39 | import cairo | 40 | import cairo |
40 | except ImportError: | 41 | except ImportError: |
41 | cls.skipTest('Python module cairo is not present') | 42 | raise unittest.SkipTest('Python module cairo is not present') |
42 | bitbake("core-image-minimal -c rootfs -f") | 43 | bitbake("core-image-minimal -c rootfs -f") |
43 | cls.tmpdir = get_bb_var('TMPDIR') | 44 | cls.tmpdir = get_bb_var('TMPDIR') |
44 | cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1] | 45 | cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1] |