diff options
author | Christian Tismer <tismer@stackless.com> | 2020-11-02 12:50:00 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-11-02 13:26:38 +0000 |
commit | 6e3e7b9ca0548430aaa5e2555d6e02c64625fa3f (patch) | |
tree | a821c90747c2376d1396a4bf58330f8b41ccbaad /testing | |
parent | 4544a943ca2df4e6f0ac24914f0c0f844dc6f748 (diff) |
replace **locals by f-strings where possible
This change affects mostly only my own sources which were
prepared for the migration to Python 3.6 .
Task-number: PYSIDE-904
Change-Id: I0c2cd59f6f625f51f876099c33005ac70ca39db9
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/command.py | 6 | ||||
-rw-r--r-- | testing/wheel_tester.py | 19 |
2 files changed, 12 insertions, 13 deletions
diff --git a/testing/command.py b/testing/command.py index d56d2509e..d6f814a34 100644 --- a/testing/command.py +++ b/testing/command.py @@ -130,7 +130,7 @@ def test_project(project, args, blacklist, runs): res = item.rich_result sharp = "#" + str(item.sharp) mod_name = decorate(item.mod_name) - print("RES {index}: Test {sharp:>4}: {res:<6} {mod_name}()".format(**locals())) + print(f"RES {index}: Test {sharp:>4}: {res:<6} {mod_name}()") r[0] += 1 if res == "PASS" else 0 r[1] += 1 if res == "FAIL!" else 0 r[2] += 1 if res == "SKIPPED" else 0 # not yet supported @@ -146,7 +146,7 @@ def test_project(project, args, blacklist, runs): "{} passed, {} failed, {} skipped, {} blacklisted, {} bpassed." .format(*r)) print() - print("********* Finished testing of %s *********" % project) + print(f"********* Finished testing of {project} *********") print() ret.append(r) if fatal: @@ -202,7 +202,7 @@ def main(): try: builds.set_buildno(args.buildno) except IndexError: - print("history out of range. Try '%s list'" % __file__) + print(f"history out of range. Try '{__file__} list'") sys.exit(1) if args.subparser_name == "getcwd": diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py index 4339d7e95..e911913da 100644 --- a/testing/wheel_tester.py +++ b/testing/wheel_tester.py @@ -150,18 +150,17 @@ def try_install_wheels(wheels_dir, py_version): log.info("") for p in package_prefix_names(): - log.info("Trying to install {p}:".format(**locals())) + log.info(f"Trying to install {p}:") pattern = "{}-*cp{}*.whl".format(p, int(float(py_version))) files = find_files_using_glob(wheels_dir, pattern) if files and len(files) == 1: wheel_path = files[0] install_wheel(wheel_path) elif len(files) > 1: - raise RuntimeError("More than one wheel found for specific {p} version." - .format(**locals())) + raise RuntimeError(f"More than one wheel found for specific {p} version.") else: - raise RuntimeError("No {p} wheels compatible with Python {py_version} found " - "for testing.".format(**locals())) + raise RuntimeError(f"No {p} wheels compatible with Python {py_version} found " + f"for testing.") def is_unix(): @@ -200,13 +199,13 @@ def generate_build_qmake(): def raise_error_pyinstaller(msg): print() - print("PYINST: {msg}".format(**locals())) - print("PYINST: sys.version = {}".format(sys.version.splitlines()[0])) - print("PYINST: platform.platform() = {}".format(platform.platform())) - print("PYINST: See the error message above.") + print(f"PYINST: {msg}") + print(f"PYINST: sys.version = {sys.version.splitlines()[0]}") + print(f"PYINST: platform.platform() = {platform.platform()}") + print(f"PYINST: See the error message above.") print() for line in run_process_output([sys.executable, "-m", "pip", "list"]): - print("PyInstaller pip list: ", line) + print(f"PyInstaller pip list: {line}") print() raise(RuntimeError(msg)) |