Repository: modin-project/modin

Issue:
ModuleNotFoundError: No module named 'modin.pandas.testing'
This module is public and is used quite often.
It shouldn't be difficult to maintain, as it has a few functions:
```python
__all__ = [
    "assert_extension_array_equal",
    "assert_frame_equal",
    "assert_series_equal",
    "assert_index_equal",
]
```


Discussion:
Interest in this module: https://github.com/modin-project/modin/issues/4236, https://github.com/modin-project/modin/issues/3029

Resolving patch:
diff --git a/modin/pandas/__init__.py b/modin/pandas/__init__.py
--- a/modin/pandas/__init__.py
+++ b/modin/pandas/__init__.py
@@ -94,6 +94,7 @@
         Float32Dtype,
         Float64Dtype,
         from_dummies,
+        testing,
     )
 
 import os


Test patch:
diff --git a/modin/pandas/test/dataframe/test_default.py b/modin/pandas/test/dataframe/test_default.py
--- a/modin/pandas/test/dataframe/test_default.py
+++ b/modin/pandas/test/dataframe/test_default.py
@@ -1365,10 +1365,10 @@ def test_setattr_axes():
         if StorageFormat.get() != "Hdk":  # Not yet supported - #1766
             df.index = ["foo", "bar"]
             # Check that ensure_index was called
-            pandas.testing.assert_index_equal(df.index, pandas.Index(["foo", "bar"]))
+            pd.testing.assert_index_equal(df.index, pandas.Index(["foo", "bar"]))
 
         df.columns = [9, 10]
-        pandas.testing.assert_index_equal(df.columns, pandas.Index([9, 10]))
+        pd.testing.assert_index_equal(df.columns, pandas.Index([9, 10]))
 
 
 @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys)
diff --git a/modin/pandas/test/dataframe/test_indexing.py b/modin/pandas/test/dataframe/test_indexing.py
--- a/modin/pandas/test/dataframe/test_indexing.py
+++ b/modin/pandas/test/dataframe/test_indexing.py
@@ -18,7 +18,6 @@
 import pandas
 import pytest
 from pandas._testing import ensure_clean
-from pandas.testing import assert_index_equal
 
 import modin.pandas as pd
 from modin.config import MinPartitionSize, NPartitions, StorageFormat
@@ -42,6 +41,7 @@
     test_data_keys,
     test_data_values,
 )
+from modin.pandas.testing import assert_index_equal
 from modin.utils import get_current_execution
 
 NPartitions.put(4)
diff --git a/modin/pandas/test/dataframe/test_map_metadata.py b/modin/pandas/test/dataframe/test_map_metadata.py
--- a/modin/pandas/test/dataframe/test_map_metadata.py
+++ b/modin/pandas/test/dataframe/test_map_metadata.py
@@ -15,7 +15,6 @@
 import numpy as np
 import pandas
 import pytest
-from pandas.testing import assert_index_equal, assert_series_equal
 
 import modin.pandas as pd
 from modin.config import NPartitions, StorageFormat
@@ -49,6 +48,7 @@
     test_func_keys,
     test_func_values,
 )
+from modin.pandas.testing import assert_index_equal, assert_series_equal
 from modin.test.test_utils import warns_that_defaulting_to_pandas
 from modin.utils import get_current_execution
 
diff --git a/modin/pandas/test/dataframe/test_reduce.py b/modin/pandas/test/dataframe/test_reduce.py
--- a/modin/pandas/test/dataframe/test_reduce.py
+++ b/modin/pandas/test/dataframe/test_reduce.py
@@ -15,7 +15,6 @@
 import numpy as np
 import pandas
 import pytest
-from pandas._testing import assert_series_equal
 
 import modin.pandas as pd
 from modin.config import Engine, NPartitions, StorageFormat
@@ -39,6 +38,7 @@
     test_data_large_categorical_dataframe,
     test_data_values,
 )
+from modin.pandas.testing import assert_series_equal
 
 NPartitions.put(4)
 
diff --git a/modin/pandas/test/test_api.py b/modin/pandas/test/test_api.py
--- a/modin/pandas/test/test_api.py
+++ b/modin/pandas/test/test_api.py
@@ -28,7 +28,6 @@ def test_top_level_api_equality():
     ignore_pandas = [
         "annotations",
         "np",
-        "testing",
         "tests",
         "pandas",
         "core",
diff --git a/modin/pandas/test/test_general.py b/modin/pandas/test/test_general.py
--- a/modin/pandas/test/test_general.py
+++ b/modin/pandas/test/test_general.py
@@ -17,11 +17,11 @@
 import pandas
 import pytest
 from numpy.testing import assert_array_equal
-from pandas.testing import assert_frame_equal
 
 import modin.pandas as pd
 from modin.config import StorageFormat
 from modin.pandas.io import to_pandas
+from modin.pandas.testing import assert_frame_equal
 from modin.test.test_utils import warns_that_defaulting_to_pandas
 from modin.utils import get_current_execution
 
diff --git a/modin/pandas/test/test_series.py b/modin/pandas/test/test_series.py
--- a/modin/pandas/test/test_series.py
+++ b/modin/pandas/test/test_series.py
@@ -23,13 +23,13 @@
 import pandas._libs.lib as lib
 import pytest
 from numpy.testing import assert_array_equal
-from pandas._testing import assert_series_equal
 from pandas.core.indexing import IndexingError
 from pandas.errors import SpecificationError
 
 import modin.pandas as pd
 from modin.config import NPartitions, StorageFormat
 from modin.pandas.io import to_pandas
+from modin.pandas.testing import assert_series_equal
 from modin.test.test_utils import warns_that_defaulting_to_pandas
 from modin.utils import get_current_execution, try_cast_to_pandas
 
diff --git a/modin/pandas/test/utils.py b/modin/pandas/test/utils.py
--- a/modin/pandas/test/utils.py
+++ b/modin/pandas/test/utils.py
@@ -35,16 +35,16 @@
     is_string_dtype,
     is_timedelta64_dtype,
 )
-from pandas.testing import (
+
+import modin.pandas as pd
+from modin.config import MinPartitionSize, NPartitions, TestDatasetSize, TrackFileLeaks
+from modin.pandas.io import to_pandas
+from modin.pandas.testing import (
     assert_extension_array_equal,
     assert_frame_equal,
     assert_index_equal,
     assert_series_equal,
 )
-
-import modin.pandas as pd
-from modin.config import MinPartitionSize, NPartitions, TestDatasetSize, TrackFileLeaks
-from modin.pandas.io import to_pandas
 from modin.utils import try_cast_to_pandas
 
 random_state = np.random.RandomState(seed=42)
diff --git a/modin/pandas/testing/__init__.py b/modin/pandas/testing/__init__.py
new file mode 100644
--- /dev/null
+++ b/modin/pandas/testing/__init__.py
@@ -0,0 +1,125 @@
+# Licensed to Modin Development Team under one or more contributor license agreements.
+# See the NOTICE file distributed with this work for additional information regarding
+# copyright ownership.  The Modin Development Team licenses this file to you under the
+# Apache License, Version 2.0 (the "License"); you may not use this file except in
+# compliance with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under
+# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+# ANY KIND, either express or implied. See the License for the specific language
+# governing permissions and limitations under the License.
+
+"""
+Public testing utility functions.
+"""
+
+from __future__ import annotations
+
+from typing import Literal
+
+from pandas._libs import lib
+from pandas.testing import assert_extension_array_equal
+from pandas.testing import assert_frame_equal as pd_assert_frame_equal
+from pandas.testing import assert_index_equal
+from pandas.testing import assert_series_equal as pd_assert_series_equal
+
+from modin.utils import _inherit_docstrings, try_cast_to_pandas
+
+
+@_inherit_docstrings(pd_assert_frame_equal, apilink="pandas.testing.assert_frame_equal")
+def assert_frame_equal(
+    left,
+    right,
+    check_dtype: bool | Literal["equiv"] = True,
+    check_index_type: bool | Literal["equiv"] = "equiv",
+    check_column_type: bool | Literal["equiv"] = "equiv",
+    check_frame_type: bool = True,
+    check_names: bool = True,
+    by_blocks: bool = False,
+    check_exact: bool | lib.NoDefault = lib.no_default,
+    check_datetimelike_compat: bool = False,
+    check_categorical: bool = True,
+    check_like: bool = False,
+    check_freq: bool = True,
+    check_flags: bool = True,
+    rtol: float | lib.NoDefault = lib.no_default,
+    atol: float | lib.NoDefault = lib.no_default,
+    obj: str = "DataFrame",
+) -> None:
+    left = try_cast_to_pandas(left)
+    right = try_cast_to_pandas(right)
+    pd_assert_frame_equal(
+        left,
+        right,
+        check_dtype=check_dtype,
+        check_index_type=check_index_type,
+        check_column_type=check_column_type,
+        check_frame_type=check_frame_type,
+        check_names=check_names,
+        by_blocks=by_blocks,
+        check_exact=check_exact,
+        check_datetimelike_compat=check_datetimelike_compat,
+        check_categorical=check_categorical,
+        check_like=check_like,
+        check_freq=check_freq,
+        check_flags=check_flags,
+        rtol=rtol,
+        atol=atol,
+        obj=obj,
+    )
+
+
+@_inherit_docstrings(
+    pd_assert_series_equal, apilink="pandas.testing.assert_series_equal"
+)
+def assert_series_equal(
+    left,
+    right,
+    check_dtype: bool | Literal["equiv"] = True,
+    check_index_type: bool | Literal["equiv"] = "equiv",
+    check_series_type: bool = True,
+    check_names: bool = True,
+    check_exact: bool | lib.NoDefault = lib.no_default,
+    check_datetimelike_compat: bool = False,
+    check_categorical: bool = True,
+    check_category_order: bool = True,
+    check_freq: bool = True,
+    check_flags: bool = True,
+    rtol: float | lib.NoDefault = lib.no_default,
+    atol: float | lib.NoDefault = lib.no_default,
+    obj: str = "Series",
+    *,
+    check_index: bool = True,
+    check_like: bool = False,
+) -> None:
+    left = try_cast_to_pandas(left)
+    right = try_cast_to_pandas(right)
+    pd_assert_series_equal(
+        left,
+        right,
+        check_dtype=check_dtype,
+        check_index_type=check_index_type,
+        check_series_type=check_series_type,
+        check_names=check_names,
+        check_exact=check_exact,
+        check_datetimelike_compat=check_datetimelike_compat,
+        check_categorical=check_categorical,
+        check_category_order=check_category_order,
+        check_freq=check_freq,
+        check_flags=check_flags,
+        rtol=rtol,
+        atol=atol,
+        obj=obj,
+        check_index=check_index,
+        check_like=check_like,
+    )
+
+
+__all__ = [
+    "assert_extension_array_equal",
+    "assert_frame_equal",
+    "assert_series_equal",
+    "assert_index_equal",
+]