Skip to content

Commit 432c623

Browse files
winklerandjreback
authored andcommitted
CLN/TST: call assert_almost_equal() when comparing Series/DataFrames
Removed previously defined helper method assert_series_or_frame_equal(), which behaved identical to assert_almost_equal()
1 parent 82a8275 commit 432c623

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pandas/tests/test_resample.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,6 @@ def _simple_pts(start, end, freq='D'):
5353
return Series(np.random.randn(len(rng)), index=rng)
5454

5555

56-
def assert_series_or_frame_equal(result, expected):
57-
if isinstance(result, Series):
58-
return assert_series_equal(result, expected)
59-
elif isinstance(result, DataFrame):
60-
return assert_frame_equal(result, expected)
61-
62-
6356
class TestResampleAPI(object):
6457

6558
def setup_method(self, method):
@@ -2271,7 +2264,7 @@ def test_asfreq_downsample(self, series_and_frame, freq, kind):
22712264
closed='left')
22722265
expected = obj.to_timestamp().reindex(new_index).to_period(freq)
22732266
result = obj.resample(freq, kind=kind).asfreq()
2274-
assert_series_or_frame_equal(result, expected)
2267+
assert_almost_equal(result, expected)
22752268

22762269
@pytest.mark.parametrize('freq', ['1H', '2H'])
22772270
@pytest.mark.parametrize('kind', ['period', None, 'timestamp'])
@@ -2287,7 +2280,7 @@ def test_asfreq_upsample(self, series_and_frame, freq, kind):
22872280
closed='left')
22882281
expected = obj.to_timestamp().reindex(new_index).to_period(freq)
22892282
result = obj.resample(freq, kind=kind).asfreq()
2290-
assert_series_or_frame_equal(result, expected)
2283+
assert_almost_equal(result, expected)
22912284

22922285
def test_asfreq_fill_value(self):
22932286
# test for fill value during resampling, issue 3715

0 commit comments

Comments
 (0)