mirror of
https://git.yoctoproject.org/poky
synced 2026-05-07 16:59:22 +00:00
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>
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user