# Path: raccoon/utils.py
# def assert_series_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two Series.
# 
#     :param left: first Series
#     :param right: second Series
#     :param data_function: if provided will use this function to assert compare the df.data
#     :param data_args: arguments to pass to the data_function
#     :return: nothing
#     """
#     assert type(left) == type(right)
#     if data_function:
#         data_args = {} if not data_args else data_args
#         data_function(left.data, right.data, **data_args)
#     else:
#         assert left.data == right.data
#     assert left.index == right.index
#     assert left.data_name == right.data_name
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     if isinstance(left, rc.ViewSeries):
#         assert left.offset == right.offset
#     if isinstance(left, rc.Series):
#         assert left.dropin == right.dropin


import pytest
import raccoon as rc
from raccoon.utils import assert_series_equal
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    srs2 = rc.ViewSeries([1, 2, 3], index=[11, 12, 13])
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    srs2 = rc.ViewSeries([1, 2, 3], index=[1, 2, 3], sort=True)
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)


def test_data_function():
    # Example function for testing
    def assert_approx_equal(left_data, right_data, precision=0.00001):
        for i in range(len(left_data)):
            assert abs(left_data[i] - right_data[i]) <= precision

    srs1 = rc.Series([1.0, 3.0], index=[1, 3])
    srs2 = rc.Series([1.0, 3.001], index=[1, 3])

    # confirm fails with standard compare
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    # passes with function and proper parameters
    assert_series_equal(srs1, srs2, assert_approx_equal, {'precision': 0.01})

    # fails with function and precision parameter to low
    with pytest.raises(AssertionError):

# Path: raccoon/utils.py
# def assert_series_equal(left, right, data_function=None, data_args=None):
#     """
#     For unit testing equality of two Series.
# 
#     :param left: first Series
#     :param right: second Series
#     :param data_function: if provided will use this function to assert compare the df.data
#     :param data_args: arguments to pass to the data_function
#     :return: nothing
#     """
#     assert type(left) == type(right)
#     if data_function:
#         data_args = {} if not data_args else data_args
#         data_function(left.data, right.data, **data_args)
#     else:
#         assert left.data == right.data
#     assert left.index == right.index
#     assert left.data_name == right.data_name
#     assert left.index_name == right.index_name
#     assert left.sort == right.sort
#     if isinstance(left, rc.ViewSeries):
#         assert left.offset == right.offset
#     if isinstance(left, rc.Series):
#         assert left.dropin == right.dropin


# Path: tests/test_series/test_utils.py
import pytest
import raccoon as rc
from raccoon.utils import assert_series_equal

    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    srs2 = rc.ViewSeries([1, 2, 3], index=[11, 12, 13])
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    srs2 = rc.ViewSeries([1, 2, 3], index=[1, 2, 3], sort=True)
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)


def test_data_function():
    # Example function for testing
    def assert_approx_equal(left_data, right_data, precision=0.00001):
        for i in range(len(left_data)):
            assert abs(left_data[i] - right_data[i]) <= precision

    srs1 = rc.Series([1.0, 3.0], index=[1, 3])
    srs2 = rc.Series([1.0, 3.001], index=[1, 3])

    # confirm fails with standard compare
    with pytest.raises(AssertionError):
        assert_series_equal(srs1, srs2)

    # passes with function and proper parameters
    assert_series_equal(srs1, srs2, assert_approx_equal, {'precision': 0.01})

    # fails with function and precision parameter to low
    with pytest.raises(AssertionError):

        assert_series_equal(srs1, srs2, assert_approx_equal, {'precision': 0.00001})