def METHOD_NAME(
    self,
    name: str,
    exc_type: type[BaseException],
    func: FuncType,
) -> None:
    """Test operations that are supposed to raise."""
    with pytest.raises(exc_type):
        func(NDArray)
    if sys.version_info >= (3, 9):
        with pytest.raises(exc_type):
            func(NDArray_ref)