From 20cb15d4702d5215cd80f2a2b7fd6eaf9cdd82f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristi=C3=A1n=20Maureira-Fredes?= Date: Mon, 12 Jul 2021 10:38:56 +0200 Subject: testing: fix flake8 warnings Change-Id: I58d0ff45607b585beb008499728998d46e4679bb Reviewed-by: Friedemann Kleint (cherry picked from commit 8ae7438a8e14d937a68199d8944fc684081be4c6) Reviewed-by: Christian Tismer --- testing/__init__.py | 5 +++-- testing/parser.py | 3 +-- testing/runner.py | 2 +- testing/wheel_tester.py | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/testing/__init__.py b/testing/__init__.py index c97f32187..001446994 100644 --- a/testing/__init__.py +++ b/testing/__init__.py @@ -44,19 +44,20 @@ testing/__init__.py - define command.main as entry point """ +import builtins import sys from . import command main = command.main # modify print so that it always flushes -__builtins__["orig_print"] = __builtins__["print"] +builtins.orig_print = builtins.print def print_flushed(*args, **kw): orig_print(*args, **kw) sys.stdout.flush() -__builtins__["print"] = print_flushed +builtins.print = print_flushed print = print_flushed diff --git a/testing/parser.py b/testing/parser.py index e22f94fda..76f1f34b2 100644 --- a/testing/parser.py +++ b/testing/parser.py @@ -131,7 +131,7 @@ def _parse_tests(test_log): for line in lines: match = re.match(pat, line, re.VERBOSE) if match: - idx, n, sharp, mod_name, much_stuff, code1, code2, tim = tup = match.groups() + idx, n, sharp, mod_name, much_stuff, code1, code2, tim = match.groups() # either code1 or code2 is None code = code1 or code2 idx, n, sharp, code, tim = int(idx), int(n), int(sharp), code.lower(), float(tim) @@ -144,7 +144,6 @@ def _parse_tests(test_log): # Use "if idx + 1 != item.idx or idx == 42:" if idx + 1 != item.idx: # The numbering is disrupted. Provoke an error in this line! - passed = False code = f"{code}, but lines are disrupted!" result[idx] = item._replace(passed=False, code=f"{item.code}, but lines are disrupted!", diff --git a/testing/runner.py b/testing/runner.py index a3bf2e265..2623b7937 100644 --- a/testing/runner.py +++ b/testing/runner.py @@ -43,7 +43,7 @@ import re import subprocess import inspect -from textwrap import dedent, indent +from textwrap import dedent from subprocess import TimeoutExpired # Get the dir path to the utils module diff --git a/testing/wheel_tester.py b/testing/wheel_tester.py index 9931f178e..4705fcdee 100644 --- a/testing/wheel_tester.py +++ b/testing/wheel_tester.py @@ -235,8 +235,8 @@ def test_nuitka(example): tmpdirname = tempfile.mkdtemp() try: os.chdir(tmpdirname) - cmd = [sys.executable, "-m", "nuitka", "--run", example]#, "--standalone"] - exit_code = run_process(cmd) + cmd = [sys.executable, "-m", "nuitka", "--run", example] # , "--standalone"] + _ = run_process(cmd) result = True except RuntimeError as e: print(str(e)) @@ -315,7 +315,6 @@ def prepare_build_folder(src_path, build_folder_name): def try_build_examples(): examples_dir = get_examples_dir() - # Disabled PyInstaller until it supports PySide 6 if False: # But because it is most likely to break, we put it here for now. -- cgit v1.2.3