mirror of https://github.com/ARMmbed/mbed-os.git
Few pyLint and pyFlakes defects fixed
parent
eed8d68789
commit
72fafcf269
|
@ -81,19 +81,19 @@ sys.path.insert(0, ROOT)
|
||||||
from workspace_tools.build_api import mcu_toolchain_matrix
|
from workspace_tools.build_api import mcu_toolchain_matrix
|
||||||
|
|
||||||
# Imports from TEST API
|
# Imports from TEST API
|
||||||
from test_api import SingleTestRunner
|
from workspace_tools.test_api import SingleTestRunner
|
||||||
from test_api import get_json_data_from_file
|
from workspace_tools.test_api import get_json_data_from_file
|
||||||
from test_api import print_muts_configuration_from_json
|
from workspace_tools.test_api import print_muts_configuration_from_json
|
||||||
from test_api import print_test_configuration_from_json
|
from workspace_tools.test_api import print_test_configuration_from_json
|
||||||
from test_api import get_avail_tests_summary_table
|
from workspace_tools.test_api import get_avail_tests_summary_table
|
||||||
from test_api import get_default_test_options_parser
|
from workspace_tools.test_api import get_default_test_options_parser
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
""" Returns test script version """
|
""" Returns test script version """
|
||||||
SINGLE_TEST_VERSION_MAJOR = 1
|
single_test_version_major = 1
|
||||||
SINGLE_TEST_VERSION_MINOR = 1
|
single_test_version_minor = 1
|
||||||
return (SINGLE_TEST_VERSION_MAJOR, SINGLE_TEST_VERSION_MINOR)
|
return (single_test_version_major, single_test_version_minor)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -37,15 +37,15 @@ from threading import Thread
|
||||||
from subprocess import Popen, PIPE, call
|
from subprocess import Popen, PIPE, call
|
||||||
|
|
||||||
# Imports related to mbed build api
|
# Imports related to mbed build api
|
||||||
from workspace_tools.build_api import build_project, build_mbed_libs, build_lib
|
|
||||||
from workspace_tools.build_api import get_target_supported_toolchains
|
|
||||||
from workspace_tools.libraries import LIBRARIES, LIBRARY_MAP
|
|
||||||
from workspace_tools.targets import TARGET_MAP
|
|
||||||
from workspace_tools.paths import BUILD_DIR
|
from workspace_tools.paths import BUILD_DIR
|
||||||
from workspace_tools.paths import HOST_TESTS
|
from workspace_tools.paths import HOST_TESTS
|
||||||
from workspace_tools.tests import TEST_MAP
|
from workspace_tools.tests import TEST_MAP
|
||||||
from workspace_tools.tests import TESTS
|
from workspace_tools.tests import TESTS
|
||||||
from workspace_tools.utils import construct_enum
|
from workspace_tools.utils import construct_enum
|
||||||
|
from workspace_tools.targets import TARGET_MAP
|
||||||
|
from workspace_tools.build_api import build_project, build_mbed_libs, build_lib
|
||||||
|
from workspace_tools.build_api import get_target_supported_toolchains
|
||||||
|
from workspace_tools.libraries import LIBRARIES, LIBRARY_MAP
|
||||||
|
|
||||||
|
|
||||||
class ProcessObserver(Thread):
|
class ProcessObserver(Thread):
|
||||||
|
@ -486,7 +486,7 @@ class SingleTestRunner(object):
|
||||||
resutl_msg = ""
|
resutl_msg = ""
|
||||||
if copy_method == 'cp' or copy_method == 'copy' or copy_method == 'xcopy':
|
if copy_method == 'cp' or copy_method == 'copy' or copy_method == 'xcopy':
|
||||||
source_path = image_path.encode('ascii', 'ignore')
|
source_path = image_path.encode('ascii', 'ignore')
|
||||||
destination_path = os.path.join(disk.encode('ascii', 'ignore'), basename(image_path).encode('ascii', 'ignore'))
|
destination_path = os.path.join(disk.encode('ascii', 'ignore'), basename(image_path).encode('ascii', 'ignore'))
|
||||||
|
|
||||||
cmd = [copy_method, source_path, destination_path]
|
cmd = [copy_method, source_path, destination_path]
|
||||||
try:
|
try:
|
||||||
|
@ -790,9 +790,9 @@ def print_muts_configuration_from_json(json_data, join_delim=", "):
|
||||||
# We need to check all unique properties for each defined MUT
|
# We need to check all unique properties for each defined MUT
|
||||||
for k in json_data:
|
for k in json_data:
|
||||||
mut_info = json_data[k]
|
mut_info = json_data[k]
|
||||||
for property in mut_info:
|
for mut_property in mut_info:
|
||||||
if property not in muts_info_cols:
|
if mut_property not in muts_info_cols:
|
||||||
muts_info_cols.append(property)
|
muts_info_cols.append(mut_property)
|
||||||
|
|
||||||
# Prepare pretty table object to display all MUTs
|
# Prepare pretty table object to display all MUTs
|
||||||
pt_cols = ["index"] + muts_info_cols
|
pt_cols = ["index"] + muts_info_cols
|
||||||
|
@ -868,7 +868,7 @@ def print_test_configuration_from_json(json_data, join_delim=", "):
|
||||||
for target in toolchain_conflicts:
|
for target in toolchain_conflicts:
|
||||||
if target not in TARGET_MAP:
|
if target not in TARGET_MAP:
|
||||||
result += "\t* Target %s unknown\n"% (target)
|
result += "\t* Target %s unknown\n"% (target)
|
||||||
conflict_target_list = ", ".join(toolchain_conflicts[target])
|
conflict_target_list = join_delim.join(toolchain_conflicts[target])
|
||||||
sufix = 's' if len(toolchain_conflicts[target]) > 1 else ''
|
sufix = 's' if len(toolchain_conflicts[target]) > 1 else ''
|
||||||
result += "\t* Target %s does not support %s toolchain%s\n"% (target, conflict_target_list, sufix)
|
result += "\t* Target %s does not support %s toolchain%s\n"% (target, conflict_target_list, sufix)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue