@@ -75,14 +75,14 @@ def test_register_option(self):
7575 def test_describe_option (self ):
7676 cf .register_option ("a" , 1 , "doc" )
7777 cf .register_option ("b" , 1 , "doc2" )
78- cf .deprecate_option ("b" )
78+ cf .deprecate_option ("b" , FutureWarning )
7979
8080 cf .register_option ("c.d.e1" , 1 , "doc3" )
8181 cf .register_option ("c.d.e2" , 1 , "doc4" )
8282 cf .register_option ("f" , 1 )
8383 cf .register_option ("g.h" , 1 )
8484 cf .register_option ("k" , 2 )
85- cf .deprecate_option ("g.h" , rkey = "k" )
85+ cf .deprecate_option ("g.h" , FutureWarning , rkey = "k" )
8686 cf .register_option ("l" , "foo" )
8787
8888 # non-existent keys raise KeyError
@@ -111,7 +111,8 @@ def test_describe_option(self):
111111 cf .set_option ("l" , "bar" )
112112 assert "bar" in cf .describe_option ("l" , _print_desc = False )
113113
114- def test_case_insensitive (self ):
114+ @pytest .mark .parametrize ("category" , [DeprecationWarning , FutureWarning ])
115+ def test_case_insensitive (self , category ):
115116 cf .register_option ("KanBAN" , 1 , "doc" )
116117
117118 assert "doc" in cf .describe_option ("kanbaN" , _print_desc = False )
@@ -124,9 +125,9 @@ def test_case_insensitive(self):
124125 with pytest .raises (OptionError , match = msg ):
125126 cf .get_option ("no_such_option" )
126127
127- cf .deprecate_option ("KanBan" )
128+ cf .deprecate_option ("KanBan" , category )
128129 msg = "'kanban' is deprecated, please refrain from using it."
129- with pytest .raises (FutureWarning , match = msg ):
130+ with pytest .raises (category , match = msg ):
130131 cf .get_option ("kAnBaN" )
131132
132133 def test_get_option (self ):
@@ -285,7 +286,7 @@ def test_reset_option_all(self):
285286
286287 def test_deprecate_option (self ):
287288 # we can deprecate non-existent options
288- cf .deprecate_option ("foo" )
289+ cf .deprecate_option ("foo" , FutureWarning )
289290
290291 with tm .assert_produces_warning (FutureWarning , match = "deprecated" ):
291292 with pytest .raises (KeyError , match = "No such keys.s.: 'foo'" ):
@@ -295,15 +296,15 @@ def test_deprecate_option(self):
295296 cf .register_option ("b.c" , "hullo" , "doc2" )
296297 cf .register_option ("foo" , "hullo" , "doc2" )
297298
298- cf .deprecate_option ("a" , removal_ver = "nifty_ver" )
299+ cf .deprecate_option ("a" , FutureWarning , removal_ver = "nifty_ver" )
299300 with tm .assert_produces_warning (FutureWarning , match = "eprecated.*nifty_ver" ):
300301 cf .get_option ("a" )
301302
302303 msg = "Option 'a' has already been defined as deprecated"
303304 with pytest .raises (OptionError , match = msg ):
304- cf .deprecate_option ("a" )
305+ cf .deprecate_option ("a" , FutureWarning )
305306
306- cf .deprecate_option ("b.c" , "zounds!" )
307+ cf .deprecate_option ("b.c" , FutureWarning , "zounds!" )
307308 with tm .assert_produces_warning (FutureWarning , match = "zounds!" ):
308309 cf .get_option ("b.c" )
309310
@@ -313,7 +314,7 @@ def test_deprecate_option(self):
313314 assert cf .get_option ("d.a" ) == "foo"
314315 assert cf .get_option ("d.dep" ) == "bar"
315316
316- cf .deprecate_option ("d.dep" , rkey = "d.a" ) # reroute d.dep to d.a
317+ cf .deprecate_option ("d.dep" , FutureWarning , rkey = "d.a" ) # reroute d.dep to d.a
317318 with tm .assert_produces_warning (FutureWarning , match = "eprecated" ):
318319 assert cf .get_option ("d.dep" ) == "foo"
319320
0 commit comments