Replace warning with slightly better testing

Testing LOGWARN was generating a real warning that polluted test output.
Instead, let's catch the warning and test that it actually happens.