Python2+3: tests passing

pull/5848/head
Jimmy Brisson 2018-01-12 15:56:14 -06:00
parent cca4425af6
commit 4322bee175
4 changed files with 5 additions and 5 deletions

View File

@ -665,7 +665,7 @@ class Config(object):
# Check for invalid cumulative overrides in libraries
if (unit_kind == 'library' and
any(attr.startswith('target.extra_labels') for attr
in overrides.iterkeys())):
in overrides.keys())):
raise ConfigException(
"Target override 'target.extra_labels' in " +
ConfigParameter.get_display_name(unit_name, unit_kind,

View File

@ -408,7 +408,7 @@ class _IarParser(_Parser):
if (not arg.startswith("-")) and arg.endswith(".o"):
self.cmd_modules[basename(arg)] = arg
common_prefix = dirname(commonprefix(self.cmd_modules.values()))
common_prefix = dirname(commonprefix(list(self.cmd_modules.values())))
self.cmd_modules = {s: relpath(f, common_prefix)
for s, f in self.cmd_modules.items()}

View File

@ -59,7 +59,7 @@ class BuildApiTests(unittest.TestCase):
@patch('os.mkdir')
@patch('tools.toolchains.exists', return_value=True)
@patch('tools.toolchains.mbedToolchain.dump_build_profile')
@patch('tools.utils.run_cmd', return_value=("", "", 0))
@patch('tools.utils.run_cmd', return_value=(b'', b'', 0))
def test_always_complete_build(self, *_):
with MagicMock() as notify:
toolchain = prepare_toolchain(self.src_paths, self.build_path, self.target,

View File

@ -40,7 +40,7 @@ def compare_config(cfg, expected):
except KeyError:
return "Unexpected key '%s' in configuration data" % k
for k in expected:
if k not in ["expected_macros", "expected_features"] + cfg.keys():
if k not in ["expected_macros", "expected_features"] + list(cfg.keys()):
return "Expected key '%s' was not found in configuration data" % k
return ""
@ -85,7 +85,7 @@ def test_config(name):
if expected_features is not None:
assert sorted(expected_features) == sorted(features)
except ConfigException as e:
err_msg = e.message
err_msg = str(e)
if "exception_msg" not in expected:
assert not(err_msg), "Unexpected Error: %s" % e
else: