fix test failure with template_tests by changing warning catch