diff options
| author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-12-31 01:29:43 +0100 |
|---|---|---|
| committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-01-05 10:18:02 +0100 |
| commit | 2de3a763fa18d5c30c2cff25057f1b81ceeed231 (patch) | |
| tree | 4b3920a147714c36e0b4d734090a6d5c646a32e2 /testing/runner.py | |
| parent | 3f6c13dc7b4241c924b0b4366e3cbc94572737b7 (diff) | |
testing: solve flake8 warnings
Pick-to: 6.0
Change-Id: I75f1a367c8a86ec586820bd4a45339773c15a70a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'testing/runner.py')
| -rw-r--r-- | testing/runner.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/testing/runner.py b/testing/runner.py index 09b873d26..084ca60ec 100644 --- a/testing/runner.py +++ b/testing/runner.py @@ -43,11 +43,8 @@ import re import subprocess import inspect -from collections import namedtuple from textwrap import dedent - -from .buildlog import builds -from .helper import decorate, TimeoutExpired +from subprocess import TimeoutExpired # Get the dir path to the utils module try: @@ -61,6 +58,7 @@ build_scripts_dir = os.path.abspath(os.path.join(this_dir, '../build_scripts')) sys.path.append(build_scripts_dir) from utils import detect_clang + class TestRunner(object): def __init__(self, log_entry, project, index): self.log_entry = log_entry @@ -82,7 +80,7 @@ class TestRunner(object): if clang_dir[0]: clang_bin_dir = os.path.join(clang_dir[0], 'bin') path = os.environ.get('PATH') - if not clang_bin_dir in path: + if clang_bin_dir not in path: os.environ['PATH'] = clang_bin_dir + os.pathsep + path print("Adding %s as detected by %s to PATH" % (clang_bin_dir, clang_dir[1])) @@ -161,6 +159,7 @@ class TestRunner(object): cwd=self.test_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + def py_tee(input, output, label): ''' A simple (incomplete) tee command in Python @@ -208,12 +207,12 @@ class TestRunner(object): stdin=ctest_process.stdout) try: comm = tee_process.communicate - output = comm(timeout=timeout)[0] + _ = comm(timeout=timeout)[0] except (TimeoutExpired, KeyboardInterrupt): print() print("aborted, partial result") ctest_process.kill() - outs, errs = ctest_process.communicate() + _ = ctest_process.communicate() # ctest lists to a temp file. Move it to the log tmp_name = self.logfile + ".tmp" if os.path.exists(tmp_name): @@ -237,4 +236,3 @@ class TestRunner(object): words = "^(" + "|".join(rerun) + ")$" cmd += ("--tests-regex", words) self._run(cmd, label, timeout) -# eof |
