Silence error logging while running tests that are intended to produce errors

The errors in the test log are distracting, making it look like
a test actually failed.
Merge pull request #1153 from mstorsjo/silence-error-testing

Silence error logging while running tests that are intended to produce errors