@@ -2117,25 +2117,31 @@ def test_drop_variables(self):
21172117 def test_drop_index_labels (self ):
21182118 data = Dataset ({"A" : (["x" , "y" ], np .random .randn (2 , 3 )), "x" : ["a" , "b" ]})
21192119
2120- actual = data .drop (["a" ], "x" )
2120+ with pytest .warns (DeprecationWarning ):
2121+ actual = data .drop (["a" ], "x" )
21212122 expected = data .isel (x = [1 ])
21222123 assert_identical (expected , actual )
21232124
2124- actual = data .drop (["a" , "b" ], "x" )
2125+ with pytest .warns (DeprecationWarning ):
2126+ actual = data .drop (["a" , "b" ], "x" )
21252127 expected = data .isel (x = slice (0 , 0 ))
21262128 assert_identical (expected , actual )
21272129
21282130 with pytest .raises (KeyError ):
21292131 # not contained in axis
2130- data .drop (["c" ], dim = "x" )
2132+ with pytest .warns (DeprecationWarning ):
2133+ data .drop (["c" ], dim = "x" )
21312134
2132- actual = data .drop (["c" ], dim = "x" , errors = "ignore" )
2135+ with pytest .warns (DeprecationWarning ):
2136+ actual = data .drop (["c" ], dim = "x" , errors = "ignore" )
21332137 assert_identical (data , actual )
21342138
21352139 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" )
21372142
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" )
21392145 expected = data .isel (x = slice (0 , 0 ))
21402146 assert_identical (expected , actual )
21412147
0 commit comments