Commit 491c1944 authored by Akim Demaille's avatar Akim Demaille
Browse files

Tests: fix portability to newest IPython

It now fails when an exception escapes.
parent f73ececa
Pipeline #1525 passed with stage
in 140 minutes and 45 seconds
......@@ -80,10 +80,14 @@ if ipython:
print("Checking IPython")
for t in tests:
print("running {} {}".format(ipython, mefile(t, 'ipy')))
# Depending on the version IPython doesn't fail and prints on stdout,
# so not try..except, redirection to stdout nor warning removal here.
# However the warnings will still appear on stderr, so redirect to devnull.
output = subprocess.check_output([ipython, mefile(t, 'ipy')],
stderr=subprocess.DEVNULL)
try:
output = subprocess.check_output([ipython, mefile(t, 'ipy')],
stderr=subprocess.DEVNULL)
except Exception as e:
output = e.output
output = output.decode('utf-8')
## Clean up absolute paths (possibly ~/src/...).
output = re.sub('~?/.*?([^/\n]+/[^/\n]+) in', r'\1 in', output)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment