# Path: harold/_array_validators.py
# def _assert_square(*arrays):
#     for a in arrays:
#         m, n = a.shape[-2:]
#         if m != n:
#             raise LinAlgError('Last 2 dimensions of the array must be square'
#                               '. Found an array with shape: {}x{}'.format(m, n)
#                               )
# 
# def _assert_2d(*arrays):
#     for a in arrays:
#         if a.ndim != 2:
#             raise LinAlgError('{}-dimensional array given. Array must be '
#                               'two-dimensional'.format(a.ndim))
# 
# def _assert_finite(*arrays):
#     for a in arrays:
#         if not np.isfinite(a).all():
#             raise LinAlgError("Array must not contain infs or NaNs")


import numpy as np
from numpy.linalg import LinAlgError
from pytest import raises as assert_raises
from harold._array_validators import _assert_square, _assert_2d, _assert_finite



def test_assert_square():
    a, b, c = np.array([[1, 2, 3]]), np.eye(2), np.array([[[1, 2], [3, 5]]])
    assert_raises(LinAlgError, _assert_square, a, b, c)


def test_assert_2d():
    a, b, c = np.array([[1, 2, 3]]), np.eye(2), np.array([[[1, 2], [3, 5]]])
    assert_raises(LinAlgError, _assert_2d, a, b, c)


def test_assert_finite():
    a, b = np.array([[1, 2, np.NaN]]), np.eye(2)

# Path: harold/_array_validators.py
# def _assert_square(*arrays):
#     for a in arrays:
#         m, n = a.shape[-2:]
#         if m != n:
#             raise LinAlgError('Last 2 dimensions of the array must be square'
#                               '. Found an array with shape: {}x{}'.format(m, n)
#                               )
# 
# def _assert_2d(*arrays):
#     for a in arrays:
#         if a.ndim != 2:
#             raise LinAlgError('{}-dimensional array given. Array must be '
#                               'two-dimensional'.format(a.ndim))
# 
# def _assert_finite(*arrays):
#     for a in arrays:
#         if not np.isfinite(a).all():
#             raise LinAlgError("Array must not contain infs or NaNs")


# Path: harold/tests/test_array_validators.py
import numpy as np
from numpy.linalg import LinAlgError
from pytest import raises as assert_raises
from harold._array_validators import _assert_square, _assert_2d, _assert_finite




def test_assert_square():
    a, b, c = np.array([[1, 2, 3]]), np.eye(2), np.array([[[1, 2], [3, 5]]])
    assert_raises(LinAlgError, _assert_square, a, b, c)


def test_assert_2d():
    a, b, c = np.array([[1, 2, 3]]), np.eye(2), np.array([[[1, 2], [3, 5]]])
    assert_raises(LinAlgError, _assert_2d, a, b, c)


def test_assert_finite():
    a, b = np.array([[1, 2, np.NaN]]), np.eye(2)

    assert_raises(LinAlgError, _assert_finite, a, b)