Ensuring that an error message in the last test in a suite is correctly parsed

I ran into this issue while testing out CI systems - one of the tracebacks from my test errors was going missing. Much like we collect the output and add it to the last test when we encounter a new test, we must do the same at the end of a suite.

Using a closure was the easiest way to reuse the code.