catch expected warnings in test