[riot-notifications] [RIOT-OS/RIOT] dist/pythonlibs: provide unittest TestCase wrapper for testrunner (#10431)

Gaëtan Harter notifications at github.com
Tue Jan 29 17:52:58 CET 2019


cladmi commented on this pull request.



> +
+
+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]
+    return (pos[3], os.path.relpath(os.path.abspath(pos[0]), RIOTBASE), pos[1])
+
+
+def setup_child(timeout=10, spawnclass=pexpect.spawnu, env={}, logfile=None):
+    child = spawnclass("make term", env=env, timeout=timeout,
+                       codec_errors='replace', echo=(logfile is not None))

I would not change the `echo` value here. This one is for `local echo` if I am right. Somewhere in https://pexpect.readthedocs.io/en/stable/api/pexpect.html#spawn-class

> The echo attribute may be set to False to disable echoing of input. As a pseudo-terminal, all input echoed by the “keyboard” (send() or sendline()) will be repeated to output. For many cases, it is not desirable to have echo enabled, and it may be later disabled using setecho(False) followed by waitnoecho(). However, for some platforms such as Solaris, this is not possible, and should be disabled immediately on spawn.

So I would not confuse it with the previous 'echo' that was here before.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10431#pullrequestreview-197665442
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190129/79868cfd/attachment.html>


More information about the notifications mailing list