summaryrefslogtreecommitdiffstats
path: root/scripts/oe-selftest
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/oe-selftest')
-rwxr-xr-xscripts/oe-selftest10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index f621fd7e4e..6422505d8f 100755
--- a/scripts/oe-selftest
+++ b/scripts/oe-selftest
@@ -1,4 +1,4 @@
1#!/usr/bin/env python 1#!/usr/bin/env python3
2 2
3# Copyright (c) 2013 Intel Corporation 3# Copyright (c) 2013 Intel Corporation
4# 4#
@@ -34,6 +34,8 @@ import subprocess
34import time as t 34import time as t
35import re 35import re
36import fnmatch 36import fnmatch
37import collections
38import imp
37 39
38sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib') 40sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + '/lib')
39import scriptpath 41import scriptpath
@@ -211,7 +213,7 @@ def get_tests_from_module(tmod):
211 try: 213 try:
212 import importlib 214 import importlib
213 modlib = importlib.import_module(tmod) 215 modlib = importlib.import_module(tmod)
214 for mod in vars(modlib).values(): 216 for mod in list(vars(modlib).values()):
215 if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest: 217 if isinstance(mod, type(oeSelfTest)) and issubclass(mod, oeSelfTest) and mod is not oeSelfTest:
216 for test in dir(mod): 218 for test in dir(mod):
217 if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'): 219 if test.startswith('test_') and hasattr(vars(mod)[test], '__call__'):
@@ -415,7 +417,7 @@ def coverage_report():
415 # Coverage under version 4 uses coverage.coverage 417 # Coverage under version 4 uses coverage.coverage
416 from coverage import coverage as Coverage 418 from coverage import coverage as Coverage
417 419
418 import cStringIO as StringIO 420 import io as StringIO
419 from coverage.misc import CoverageException 421 from coverage.misc import CoverageException
420 422
421 cov_output = StringIO.StringIO() 423 cov_output = StringIO.StringIO()
@@ -492,7 +494,7 @@ def main():
492 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest: 494 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
493 print(" --", v) 495 print(" --", v)
494 for method in dir(t): 496 for method in dir(t):
495 if method.startswith("test_") and callable(vars(t)[method]): 497 if method.startswith("test_") and isinstance(vars(t)[method], collections.Callable):
496 print(" -- --", method) 498 print(" -- --", method)
497 499
498 except (AttributeError, ImportError) as e: 500 except (AttributeError, ImportError) as e: