Skip to contentSkip to conversation

oescripts.py: avoid error when cairo module is not available

PATCH New Chen Qi 1 participant 2 messages Jun 14, 2019

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover oescripts.py: avoid error when cairo module is not available

*** BLURB HERE ***
The following changes since commit e00d88475d0ed7b161f5f58dd13bc9a72e3efdf9:

bluez: fix test case failures with GCC 9 (2019-06-12 21:08:52 +0100)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/oescripts-cairo
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/oescripts-cairo

Chen Qi (1):
oescripts.py: avoid error when cairo module is not available

 meta/lib/oeqa/selftest/cases/oescripts.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 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.

---
 meta/lib/oeqa/selftest/cases/oescripts.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/oescripts.py +2 -1
index 217afe3..7770b66 100644
@@ -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]
Signature · 1 line
1.9.1