Exemple #1
0
def test_are_all_equal_not_implemented():
    """
    Test that :func:`utils.are_all_equal` raises an exception on
    multidimensional arrays.
    """
    value = np.zeros((3, 4))
    with pytest.raises(NotImplementedError):
        utils.are_all_equal(value)
Exemple #2
0
def test_are_all_equal_multidim_list(values, ref):
    """
    Test :func:`utils.are_all_equal` works on nested lists.
    """
    assert utils.are_all_equal(values) is ref
Exemple #3
0
def test_are_all_equal(values, ref, iter_type):
    """
    Make sure that :func:`utils.are_all_equal` works as expected.
    """
    assert utils.are_all_equal(iter_type(values)) is ref