[oe-commits] [openembedded-core] 11/22: oescripts.py: avoid error when cairo module is not available
git at git.openembedded.org
git at git.openembedded.org
Fri Jun 14 07:57:23 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository openembedded-core.
commit 848513bf4826a3d78ddee4ae551d89f3923ad7df
Author: Chen Qi <Qi.Chen at windriver.com>
AuthorDate: Fri Jun 14 14:32:18 2019 +0800
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.
Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/selftest/cases/oescripts.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index 217afe3..7770b66 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -3,6 +3,7 @@
#
import os
+import unittest
from oeqa.selftest.case import OESelftestTestCase
from oeqa.selftest.cases.buildhistory import BuildhistoryBase
from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
@@ -38,7 +39,7 @@ class OEScriptTests(OESelftestTestCase):
try:
import cairo
except ImportError:
- cls.skipTest('Python module cairo is not present')
+ raise unittest.SkipTest('Python module cairo is not present')
bitbake("core-image-minimal -c rootfs -f")
cls.tmpdir = get_bb_var('TMPDIR')
cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list