tests: raise ParseError on error/fatal severity

The previous test code raised ParseError exceptions on any
diagnostics, including warnings or information. It only makes sense
to report diagnostics that indicate the code is broken (i.e. error
or fatal diagnostics).