diff --git a/pandas/tests/frame/test_analytics.py b/pandas/tests/frame/test_analytics.py index c202a07c9ef8a..93514a8a42215 100644 --- a/pandas/tests/frame/test_analytics.py +++ b/pandas/tests/frame/test_analytics.py @@ -1934,10 +1934,13 @@ def test_clip_against_frame(self, axis): def test_clip_with_na_args(self): """Should process np.nan argument as None """ # GH # 17276 - self.frame.clip(np.nan) - self.frame.clip(upper=[1, 2, np.nan]) - self.frame.clip(lower=[1, np.nan, 3]) - self.frame.clip(upper=np.nan, lower=np.nan) + tm.assert_frame_equal(self.frame.clip(np.nan), self.frame) + tm.assert_frame_equal(self.frame.clip(upper=[1, 2, np.nan]), + self.frame) + tm.assert_frame_equal(self.frame.clip(lower=[1, np.nan, 3]), + self.frame) + tm.assert_frame_equal(self.frame.clip(upper=np.nan, lower=np.nan), + self.frame) # Matrix-like diff --git a/pandas/tests/series/test_analytics.py b/pandas/tests/series/test_analytics.py index 13900536227e0..f1d044f7a1132 100644 --- a/pandas/tests/series/test_analytics.py +++ b/pandas/tests/series/test_analytics.py @@ -1005,10 +1005,11 @@ def test_clip_with_na_args(self): # GH # 17276 s = Series([1, 2, 3]) - s.clip(np.nan) - s.clip(upper=[1, 2, np.nan]) - s.clip(lower=[1, np.nan, 3]) - s.clip(upper=np.nan, lower=np.nan) + assert_series_equal(s.clip(np.nan), Series([1, 2, 3])) + assert_series_equal(s.clip(upper=[1, 1, np.nan]), Series([1, 2, 3])) + assert_series_equal(s.clip(lower=[1, np.nan, 1]), Series([1, 2, 3])) + assert_series_equal(s.clip(upper=np.nan, lower=np.nan), + Series([1, 2, 3])) def test_clip_against_series(self): # GH #6966