BUG: Simplify assert_produces_warning to get it to pass.