Merge pull request #8301 from aabadie/pr/flake8/testrunner
dist/tools/testrunner: fix flake8 remaining issues
This commit is contained in:
commit
2a0b34d25d
@ -1,7 +1,8 @@
|
|||||||
dist: trusty
|
dist: trusty
|
||||||
|
|
||||||
before_install:
|
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:
|
script:
|
||||||
- make static-test
|
- make static-test
|
||||||
|
|||||||
2
dist/tools/testrunner/testrunner.py
vendored
2
dist/tools/testrunner/testrunner.py
vendored
@ -27,12 +27,14 @@ MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
|
|||||||
def list_until(l, cond):
|
def list_until(l, cond):
|
||||||
return l[:([i for i, e in enumerate(l) if cond(e)][0])]
|
return l[:([i for i, e in enumerate(l) if cond(e)][0])]
|
||||||
|
|
||||||
|
|
||||||
def find_exc_origin(exc_info):
|
def find_exc_origin(exc_info):
|
||||||
pos = list_until(extract_tb(exc_info),
|
pos = list_until(extract_tb(exc_info),
|
||||||
lambda frame: frame[0].startswith(PEXPECT_PATH)
|
lambda frame: frame[0].startswith(PEXPECT_PATH)
|
||||||
)[-1]
|
)[-1]
|
||||||
return (pos[3], os.path.relpath(os.path.abspath(pos[0]), RIOTBASE), pos[1])
|
return (pos[3], os.path.relpath(os.path.abspath(pos[0]), RIOTBASE), pos[1])
|
||||||
|
|
||||||
|
|
||||||
def run(testfunc, timeout=10, echo=True, traceback=False):
|
def run(testfunc, timeout=10, echo=True, traceback=False):
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
child = pexpect.spawnu("make term", env=env, timeout=timeout)
|
child = pexpect.spawnu("make term", env=env, timeout=timeout)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user