summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 11:57:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-02 08:24:01 +0100
commit3b3997174831931ea472167ba6cc854a4972ccce (patch)
tree861b0bcb54e70fbe59bf7920862954dcec40a1e8 /scripts
parent52c4b7f247618f185a11dfb1cf15d0490d074379 (diff)
downloadpoky-3b3997174831931ea472167ba6cc854a4972ccce.tar.gz
classes/lib: Complete transition to python3
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/oe-selftest10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/oe-selftest b/scripts/oe-selftest
index db132fdf9f..b1ecf7f322 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
@@ -414,7 +416,7 @@ def coverage_report():
414 # Coverage under version 4 uses coverage.coverage 416 # Coverage under version 4 uses coverage.coverage
415 from coverage import coverage as Coverage 417 from coverage import coverage as Coverage
416 418
417 import cStringIO as StringIO 419 import io as StringIO
418 from coverage.misc import CoverageException 420 from coverage.misc import CoverageException
419 421
420 cov_output = StringIO.StringIO() 422 cov_output = StringIO.StringIO()
@@ -442,7 +444,7 @@ def main():
442 bbpath = get_bb_var('BBPATH').split(':') 444 bbpath = get_bb_var('BBPATH').split(':')
443 layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)] 445 layer_libdirs = [p for p in (os.path.join(l, 'lib') for l in bbpath) if os.path.exists(p)]
444 sys.path.extend(layer_libdirs) 446 sys.path.extend(layer_libdirs)
445 reload(oeqa.selftest) 447 imp.reload(oeqa.selftest)
446 448
447 if args.run_tests_by and len(args.run_tests_by) >= 2: 449 if args.run_tests_by and len(args.run_tests_by) >= 2:
448 valid_options = ['name', 'class', 'module', 'id', 'tag'] 450 valid_options = ['name', 'class', 'module', 'id', 'tag']
@@ -491,7 +493,7 @@ def main():
491 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest: 493 if isinstance(t, type(oeSelfTest)) and issubclass(t, oeSelfTest) and t!=oeSelfTest:
492 print(" --", v) 494 print(" --", v)
493 for method in dir(t): 495 for method in dir(t):
494 if method.startswith("test_") and callable(vars(t)[method]): 496 if method.startswith("test_") and isinstance(vars(t)[method], collections.Callable):
495 print(" -- --", method) 497 print(" -- --", method)
496 498
497 except (AttributeError, ImportError) as e: 499 except (AttributeError, ImportError) as e: