From d13082430513a0ebcb61f0c4ad79eebeab27194f Mon Sep 17 00:00:00 2001 From: Margaret Sy Date: Sat, 3 Jun 2017 10:39:10 -0700 Subject: [PATCH] add tests for direct slicing --- pandas/tests/indexing/test_loc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index 571268fba86c8..3e863a59df67e 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -636,6 +636,7 @@ def test_identity_slice_returns_new_object(self): original_df = DataFrame({'a': [1, 2, 3]}) sliced_df = original_df.loc[:] assert sliced_df is not original_df + assert original_df[:] is not original_df # should be a shallow copy original_df['a'] = [4, 4, 4] @@ -650,6 +651,7 @@ def test_identity_slice_returns_new_object(self): original_series = Series([1, 2, 3, 4, 5, 6]) sliced_series = original_series.loc[:] assert sliced_series is not original_series + assert original_series[:] is not original_series original_series[:3] = [7, 8, 9] assert all(sliced_series[:3] == [7, 8, 9])