]> code.ossystems Code Review - openembedded-core.git/commitdiff
test-utils: handle import bb failing and skip the test
authorRoss Burton <ross.burton@intel.com>
Thu, 23 May 2013 11:34:04 +0000 (12:34 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Jun 2013 15:41:01 +0000 (16:41 +0100)
Instead of reporting an error when bb cannot be imported, skip the test
instead. This makes it a lot easier to iterate a test suite when we don't care
about this particular test.

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/lib/oe/tests/test_utils.py

index 78b1361161bdcfe00a0532dda64ffff1536bd820..5e1ea0e6ea41793f72355b54c5c0b20b31ce326a 100644 (file)
@@ -1,11 +1,15 @@
 import unittest
-import bb, oe.utils
+import oe.utils
 
 class TestPackagesFilterOutSystem(unittest.TestCase):
     def test_filter(self):
         """
         Test that oe.utils.packages_filter_out_system works.
         """
+        try:
+            import bb
+        except ImportError:
+            self.skipTest("Cannot import bb")
 
         d = bb.data_smart.DataSmart()
         d.setVar("PN", "foo")