<commit_before>import numpy as np
import pytest

from pandas.core.dtypes.cast import maybe_upcast_putmask

from pandas import Series
import pandas._testing as tm


@pytest.mark.parametrize("result", [Series([10, 11, 12]), [10, 11, 12], (10, 11, 12)])
def test_upcast_error(result):
    # GH23823 require result arg to be ndarray
    mask = np.array([False, True, False])
    other = np.array([61, 62, 63])
    with pytest.raises(ValueError):
        result, _ = maybe_upcast_putmask(result, mask, other)


@pytest.mark.parametrize(
    "arr, other",
    [
        (np.arange(1, 6), np.array([61, 62, 63])),
        (np.arange(1, 6), np.array([61.1, 62.2, 63.3])),
        (np.arange(10, 15), np.array([61, 62])),<commit_msg>Avoid bare pytest.raises in dtypes/cast/test_upcast.py (#32603)<commit_after>import numpy as np
import pytest

from pandas.core.dtypes.cast import maybe_upcast_putmask

from pandas import Series
import pandas._testing as tm


@pytest.mark.parametrize("result", [Series([10, 11, 12]), [10, 11, 12], (10, 11, 12)])
def test_upcast_error(result):
    # GH23823 require result arg to be ndarray
    mask = np.array([False, True, False])
    other = np.array([61, 62, 63])
    with pytest.raises(ValueError, match="The result input must be a ndarray"):
        result, _ = maybe_upcast_putmask(result, mask, other)


@pytest.mark.parametrize(
    "arr, other",
    [
        (np.arange(1, 6), np.array([61, 62, 63])),
        (np.arange(1, 6), np.array([61.1, 62.2, 63.3])),
        (np.arange(10, 15), np.array([61, 62])),
{'fraction_non_alphanumeric': 0.1614785992217899, 'fraction_numerical': 0.07587548638132295, 'mean_word_length': 3.7186544342507646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2964395', 'n_tokens_mistral': 667, 'n_tokens_neox': 579, 'n_words': 147}