Skip to content

CLN: Consistent pandas.util.testing imports in pandas/tests/frame - part1 #29300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions pandas/tests/frame/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
timedelta_range,
)
import pandas.util.testing as tm
from pandas.util.testing import (
assert_almost_equal,
assert_frame_equal,
assert_series_equal,
)


class SharedWithSparse:
Expand Down Expand Up @@ -344,7 +339,7 @@ def test_values(self, float_frame, float_string_frame):
# single block corner case
arr = float_frame[["A", "B"]].values
expected = float_frame.reindex(columns=["A", "B"]).values
assert_almost_equal(arr, expected)
tm.assert_almost_equal(arr, expected)

def test_to_numpy(self):
df = pd.DataFrame({"A": [1, 2], "B": [3, 4.5]})
Expand Down Expand Up @@ -401,11 +396,11 @@ def test_axis_aliases(self, float_frame):
# reg name
expected = f.sum(axis=0)
result = f.sum(axis="index")
assert_series_equal(result, expected)
tm.assert_series_equal(result, expected)

expected = f.sum(axis=1)
result = f.sum(axis="columns")
assert_series_equal(result, expected)
tm.assert_series_equal(result, expected)

def test_class_axis(self):
# GH 18147
Expand Down Expand Up @@ -474,8 +469,8 @@ class TestDataFrameMisc(SharedWithSparse):

klass = DataFrame
# SharedWithSparse tests use generic, klass-agnostic assertion
_assert_frame_equal = staticmethod(assert_frame_equal)
_assert_series_equal = staticmethod(assert_series_equal)
_assert_frame_equal = staticmethod(tm.assert_frame_equal)
_assert_series_equal = staticmethod(tm.assert_series_equal)

def test_values(self, float_frame):
float_frame.values[:, 0] = 5.0
Expand Down
Loading