Skip to content
Prev Previous commit
Next Next commit
add test for depr is_copy
  • Loading branch information
ryankarlos committed Jan 5, 2020
commit 17ca68620a7242f5f4592bb19ddfc2d9b41caad3
12 changes: 12 additions & 0 deletions pandas/tests/generic/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,18 @@ def test_take_invalid_kwargs(self):
with pytest.raises(ValueError, match=msg):
obj.take(indices, mode="clip")

def test_depr_take_kwarg_is_copy(self):
# GH 27357
df = DataFrame({"A": [1, 2, 3]})
msg = (
"is_copy is deprecated and will be removed in a future version. "
"take will always return a copy in the future."
)
with tm.assert_produces_warning(FutureWarning) as w:
df.take([0, 1], is_copy=True)

assert w[0].message.args[0] == msg

def test_equals(self):
s1 = pd.Series([1, 2, 3], index=[0, 2, 1])
s2 = s1.copy()
Expand Down