Skip to content

Commit b966bca

Browse files
committed
MAINT: Remove vestigial assertIsNot's
Follow-up to pandas-devgh-16024.
1 parent 5146b59 commit b966bca

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

pandas/tests/series/test_indexing.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1873,14 +1873,14 @@ def test_align_nocopy(self):
18731873
rb[:2] = 5
18741874
self.assertTrue((b[:2] == 5).all())
18751875

1876-
def test_align_sameindex(self):
1876+
def test_align_same_index(self):
18771877
a, b = self.ts.align(self.ts, copy=False)
1878-
self.assertIs(a.index, self.ts.index)
1879-
self.assertIs(b.index, self.ts.index)
1878+
assert a.index is self.ts.index
1879+
assert b.index is self.ts.index
18801880

1881-
# a, b = self.ts.align(self.ts, copy=True)
1882-
# self.assertIsNot(a.index, self.ts.index)
1883-
# self.assertIsNot(b.index, self.ts.index)
1881+
a, b = self.ts.align(self.ts, copy=True)
1882+
assert a.index is not self.ts.index
1883+
assert b.index is not self.ts.index
18841884

18851885
def test_align_multiindex(self):
18861886
# GH 10665

pandas/tests/test_panel.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -917,25 +917,25 @@ def test_constructor(self):
917917
with catch_warnings(record=True):
918918
# with BlockManager
919919
wp = Panel(self.panel._data)
920-
self.assertIs(wp._data, self.panel._data)
920+
assert wp._data is self.panel._data
921921

922922
wp = Panel(self.panel._data, copy=True)
923-
self.assertIsNot(wp._data, self.panel._data)
924-
assert_panel_equal(wp, self.panel)
923+
assert wp._data is not self.panel._data
924+
tm.assert_panel_equal(wp, self.panel)
925925

926926
# strings handled prop
927927
wp = Panel([[['foo', 'foo', 'foo', ], ['foo', 'foo', 'foo']]])
928-
self.assertEqual(wp.values.dtype, np.object_)
928+
assert wp.values.dtype == np.object_
929929

930930
vals = self.panel.values
931931

932932
# no copy
933933
wp = Panel(vals)
934-
self.assertIs(wp.values, vals)
934+
assert wp.values is vals
935935

936936
# copy
937937
wp = Panel(vals, copy=True)
938-
self.assertIsNot(wp.values, vals)
938+
assert wp.values is not vals
939939

940940
# GH #8285, test when scalar data is used to construct a Panel
941941
# if dtype is not passed, it should be inferred
@@ -946,15 +946,17 @@ def test_constructor(self):
946946
minor_axis=range(4))
947947
vals = np.empty((2, 3, 4), dtype=dtype)
948948
vals.fill(val)
949-
assert_panel_equal(wp, Panel(vals, dtype=dtype))
949+
950+
tm.assert_panel_equal(wp, Panel(vals, dtype=dtype))
950951

951952
# test the case when dtype is passed
952953
wp = Panel(1, items=range(2), major_axis=range(3),
953954
minor_axis=range(4),
954955
dtype='float32')
955956
vals = np.empty((2, 3, 4), dtype='float32')
956957
vals.fill(1)
957-
assert_panel_equal(wp, Panel(vals, dtype='float32'))
958+
959+
tm.assert_panel_equal(wp, Panel(vals, dtype='float32'))
958960

959961
def test_constructor_cast(self):
960962
with catch_warnings(record=True):

0 commit comments

Comments
 (0)