@@ -2117,25 +2117,31 @@ def test_drop_variables(self):
2117
2117
def test_drop_index_labels (self ):
2118
2118
data = Dataset ({"A" : (["x" , "y" ], np .random .randn (2 , 3 )), "x" : ["a" , "b" ]})
2119
2119
2120
- actual = data .drop (["a" ], "x" )
2120
+ with pytest .warns (DeprecationWarning ):
2121
+ actual = data .drop (["a" ], "x" )
2121
2122
expected = data .isel (x = [1 ])
2122
2123
assert_identical (expected , actual )
2123
2124
2124
- actual = data .drop (["a" , "b" ], "x" )
2125
+ with pytest .warns (DeprecationWarning ):
2126
+ actual = data .drop (["a" , "b" ], "x" )
2125
2127
expected = data .isel (x = slice (0 , 0 ))
2126
2128
assert_identical (expected , actual )
2127
2129
2128
2130
with pytest .raises (KeyError ):
2129
2131
# not contained in axis
2130
- data .drop (["c" ], dim = "x" )
2132
+ with pytest .warns (DeprecationWarning ):
2133
+ data .drop (["c" ], dim = "x" )
2131
2134
2132
- actual = data .drop (["c" ], dim = "x" , errors = "ignore" )
2135
+ with pytest .warns (DeprecationWarning ):
2136
+ actual = data .drop (["c" ], dim = "x" , errors = "ignore" )
2133
2137
assert_identical (data , actual )
2134
2138
2135
2139
with pytest .raises (ValueError ):
2136
- data .drop (["c" ], dim = "x" , errors = "wrong_value" )
2140
+ with pytest .warns (DeprecationWarning ):
2141
+ data .drop (["c" ], dim = "x" , errors = "wrong_value" )
2137
2142
2138
- actual = data .drop (["a" , "b" , "c" ], "x" , errors = "ignore" )
2143
+ with pytest .warns (DeprecationWarning ):
2144
+ actual = data .drop (["a" , "b" , "c" ], "x" , errors = "ignore" )
2139
2145
expected = data .isel (x = slice (0 , 0 ))
2140
2146
assert_identical (expected , actual )
2141
2147
0 commit comments