test_warnings: catch stderr and check warning

Check the user warning in test_error_after_default() to not pollute the output,
and check the warning logged into stderr.
1 file changed