Add assert_warns to check for warnings