Skip to content

Commit 13b9e39

Browse files
committed
TST: Added test for copying of data
1 parent a82bdde commit 13b9e39

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/indexes/test_numeric.py

+8
Original file line numberDiff line numberDiff line change
@@ -831,3 +831,11 @@ def test_ufunc_coercions(self):
831831
tm.assertIsInstance(result, Float64Index)
832832
exp = Float64Index([0.5, 1., 1.5, 2., 2.5], name='x')
833833
tm.assert_index_equal(result, exp)
834+
835+
def test_ensure_copied_data(self):
836+
data = np.array([1, 2, 3], dtype='int64')
837+
idx = Int64Index(data, copy=True)
838+
self.assert_numpy_array_equal(data, idx._data)
839+
tm.assertIsNot(data, idx._data)
840+
idx2 = Int64Index(data, copy=False)
841+
tm.assertIs(data, idx2._data)

0 commit comments

Comments
 (0)