Only error the exs test when "Error" in last line of output

init_sphinx_docs
Tyler Goodlet 2020-02-10 12:07:32 -05:00
parent 5a19826bd3
commit 63bcd99323
1 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,9 @@ def test_example(run_example_in_subproc, example_script):
err, _ = proc.stderr.read(), proc.stdout.read() err, _ = proc.stderr.read(), proc.stdout.read()
# if we get some gnarly output let's aggregate and raise # if we get some gnarly output let's aggregate and raise
if err and b'Error' in err: errmsg = err.decode()
raise Exception(err.decode()) errlines = errmsg.splitlines()
if err and 'Error' in errlines[-1]:
raise Exception(errmsg)
assert proc.returncode == 0 assert proc.returncode == 0