@@ -134,7 +134,7 @@ def check_mcu_abi(s, name):
"""
dev = os.path.join("/dev", name)
if not os.path.exists(dev):
- s.skipTest("MCU " + name + " not supported, skipping")
+ s.skipTest(f"MCU {name} not supported, skipping")
files = ["flashinfo", "reboot", "version"]
sysfs_check_attributes_exists(
s, "/sys/class/chromeos/", name, files, False
@@ -145,7 +145,7 @@ def mcu_hello(s, name):
""" Checks basic comunication with MCU. """
dev = os.path.join("/dev", name)
if not os.path.exists(dev):
- s.skipTest("MCU " + name + " not present, skipping")
+ s.skipTest(f"MCU {name} not present, skipping")
param = ec_params_hello()
param.in_data = 0xA0B0C0D0 # magic number that the EC expects on HELLO
@@ -66,7 +66,7 @@ class TestCrosECAccel(unittest.TestCase):
err = exp * ACCEL_MAG_VALID_OFFSET
mag = 0
for axis in ["x", "y", "z"]:
- axis_path = os.path.join(base_path, "in_accel_" + axis + "_raw")
+ axis_path = os.path.join(base_path, f"in_accel_{axis}_raw")
value = int(read_file(axis_path))
value *= accel_scale
mag += value * value
Don't use "+" operator for concatenating strings. Use f-string instead. Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> --- cros/helpers/mcu.py | 4 ++-- cros/tests/cros_ec_accel.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)