From 284ce5b784e41d2888dc4db48697e5fa2e5e27e8 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 20 Dec 2017 13:34:42 +0100 Subject: [PATCH 1/2] travis: install flake8 using pip3 this ensure no python2 flake8 will be installed and prevent confusion with required python3 flake8 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 52f1bb7a6c..72cea2d86c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,8 @@ dist: trusty before_install: - - sudo apt-get install coreutils realpath doxygen graphviz python-lesscpy cppcheck coccinelle pcregrep python3-flake8 + - sudo apt-get install coreutils realpath doxygen graphviz python-lesscpy cppcheck coccinelle pcregrep python3-pip + - sudo pip3 install flake8 script: - make static-test From 58ab6dd3fecbad6fe0f800871bac813dacc53380 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Wed, 20 Dec 2017 13:34:52 +0100 Subject: [PATCH 2/2] dist/tools/testrunner: fix flake8 remaining issues --- dist/tools/testrunner/testrunner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/tools/testrunner/testrunner.py b/dist/tools/testrunner/testrunner.py index 8828aad82c..15f8b8c74a 100755 --- a/dist/tools/testrunner/testrunner.py +++ b/dist/tools/testrunner/testrunner.py @@ -17,7 +17,7 @@ import pexpect PEXPECT_PATH = os.path.dirname(pexpect.__file__) RIOTBASE = os.environ['RIOTBASE'] or \ - os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) + os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) # Setting an empty 'TESTRUNNER_START_DELAY' environment variable use the # default value (3) @@ -27,12 +27,14 @@ MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3) def list_until(l, cond): return l[:([i for i, e in enumerate(l) if cond(e)][0])] + def find_exc_origin(exc_info): pos = list_until(extract_tb(exc_info), lambda frame: frame[0].startswith(PEXPECT_PATH) - )[-1] + )[-1] return (pos[3], os.path.relpath(os.path.abspath(pos[0]), RIOTBASE), pos[1]) + def run(testfunc, timeout=10, echo=True, traceback=False): env = os.environ.copy() child = pexpect.spawnu("make term", env=env, timeout=timeout)