Skip to content

Commit 391edca

Browse files
committed
TST: Do not allow inplace operations on indexes that require type promotion.
1 parent a15fee0 commit 391edca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/test_index.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,6 +2085,12 @@ def test_coerce_list(self):
20852085
def test_dtype(self):
20862086
self.assertEqual(self.index.dtype, np.int64)
20872087

2088+
def test_promote_type_inplace(self):
2089+
# Related to GH-9966
2090+
index = Int64Index(np.arange(5))
2091+
with self.assertRaises(TypeError):
2092+
index *= 0.333
2093+
20882094
def test_is_monotonic(self):
20892095
self.assertTrue(self.index.is_monotonic)
20902096
self.assertTrue(self.index.is_monotonic_increasing)

0 commit comments

Comments
 (0)