Skip to content
Snippets Groups Projects
Commit 58ab6dd3 authored by Alexandre Abadie's avatar Alexandre Abadie
Browse files

dist/tools/testrunner: fix flake8 remaining issues

parent 284ce5b7
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment