Skip to content

Commit c9f948a

Browse files
committed
Fix
1 parent 7a97430 commit c9f948a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/indexing/multiindex/test_chaining_and_caching.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import numpy as np
22
import pytest
33

4-
from pandas.errors import SettingWithCopyError
4+
from pandas.errors import (
5+
ChainedAssignmentError,
6+
SettingWithCopyError,
7+
)
58
import pandas.util._test_decorators as td
69

710
from pandas import (
@@ -30,7 +33,8 @@ def test_detect_chained_assignment(using_copy_on_write):
3033
zed = DataFrame(events, index=["a", "b"], columns=multiind)
3134

3235
if using_copy_on_write:
33-
zed["eyes"]["right"].fillna(value=555, inplace=True)
36+
with tm.assert_produces_warning(ChainedAssignmentError):
37+
zed["eyes"]["right"].fillna(value=555, inplace=True)
3438
else:
3539
msg = "A value is trying to be set on a copy of a slice from a DataFrame"
3640
with pytest.raises(SettingWithCopyError, match=msg):

0 commit comments

Comments
 (0)