[OE-core] [PATCH 25/36] oeqa/core/context: Use a default iterable modules object

Aníbal Limón anibal.limon at linux.intel.com
Fri May 26 20:37:51 UTC 2017


From: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>

The OETestLoader.modules must be an iterable object, otherwise
checking presence of specific modules with the 'in' operator fails
with the following command/error:

    % oe-test core
    .. - core - INFO - Running bitbake -p
    Traceback (most recent call last):
      File "..poky2/scripts/oe-test", line 108, in <module>
        ret = main()
      File "..poky2/scripts/oe-test", line 93, in main
        results = args.func(logger, args)
      File "..poky2/meta/lib/oeqa/core/context.py", line 235, in run
        self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
      File "..poky2/meta/lib/oeqa/core/context.py", line 53, in loadTests
        self.suites = self.loader.discover()
      File "..poky2/meta/lib/oeqa/core/loader.py", line 204, in discover
        pattern='*.py', top_level_dir=path)
      File "/usr/lib64/python3.4/unittest/loader.py", line 275, in discover
        tests = list(self._find_tests(start_dir, pattern))
      File "/usr/lib64/python3.4/unittest/loader.py", line 339, in _find_tests
        yield self.loadTestsFromModule(module)
      File "..poky2/meta/lib/oeqa/core/loader.py", line 266, in loadTestsFromModule
        and module.__name__ in self.modules \
    TypeError: argument of type 'NoneType' is not iterable

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez at linux.intel.com>
---
 meta/lib/oeqa/core/context.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py
index 1ac2878..20d8236 100644
--- a/meta/lib/oeqa/core/context.py
+++ b/meta/lib/oeqa/core/context.py
@@ -139,7 +139,7 @@ class OETestContextExecutor(object):
         if args.run_tests:
             self.tc_kwargs['load']['modules'] = args.run_tests
         else:
-            self.tc_kwargs['load']['modules'] = None
+            self.tc_kwargs['load']['modules'] = []
 
         self.module_paths = args.CASES_PATHS
 
-- 
2.1.4




More information about the Openembedded-core mailing list