From 63bcd99323b265aa33c5da99c89dea8988e16b11 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 10 Feb 2020 12:07:32 -0500 Subject: [PATCH] Only error the exs test when "Error" in last line of output --- tests/test_docs_examples.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_docs_examples.py b/tests/test_docs_examples.py index 8776372..f45e6eb 100644 --- a/tests/test_docs_examples.py +++ b/tests/test_docs_examples.py @@ -99,7 +99,9 @@ def test_example(run_example_in_subproc, example_script): err, _ = proc.stderr.read(), proc.stdout.read() # if we get some gnarly output let's aggregate and raise - if err and b'Error' in err: - raise Exception(err.decode()) + errmsg = err.decode() + errlines = errmsg.splitlines() + if err and 'Error' in errlines[-1]: + raise Exception(errmsg) assert proc.returncode == 0