@@ -50,38 +50,44 @@ def test_get_param(self):
50
50
assert ct .config ._get_param ('config' ,'test4' , {'test4' :1 },None )== 1
51
51
52
52
def test_default_deprecation (self ):
53
- ct .config .defaults ['config.newkey' ]= 1
54
53
ct .config .defaults ['deprecated.config.oldkey' ]= 'config.newkey'
55
54
ct .config .defaults ['deprecated.config.oldmiss' ]= 'config.newmiss'
56
55
57
56
msgpattern = r'config\.oldkey.* has been renamed to .*config\.newkey'
58
57
59
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
58
+ ct .config .defaults ['config.newkey' ]= 1
59
+ with pytest .warns (FutureWarning ,match = msgpattern ):
60
60
assert ct .config .defaults ['config.oldkey' ]== 1
61
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
61
+ with pytest .warns (FutureWarning ,match = msgpattern ):
62
62
ct .config .defaults ['config.oldkey' ]= 2
63
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
63
+ with pytest .warns (FutureWarning ,match = msgpattern ):
64
64
assert ct .config .defaults ['config.oldkey' ]== 2
65
65
assert ct .config .defaults ['config.newkey' ]== 2
66
66
67
67
ct .config .set_defaults ('config' ,newkey = 3 )
68
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
68
+ with pytest .warns (FutureWarning ,match = msgpattern ):
69
69
assert ct .config ._get_param ('config' ,'oldkey' )== 3
70
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
70
+ with pytest .warns (FutureWarning ,match = msgpattern ):
71
71
ct .config .set_defaults ('config' ,oldkey = 4 )
72
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
72
+ with pytest .warns (FutureWarning ,match = msgpattern ):
73
73
assert ct .config .defaults ['config.oldkey' ]== 4
74
74
assert ct .config .defaults ['config.newkey' ]== 4
75
75
76
+ ct .config .defaults .update ({'config.newkey' :5 })
77
+ with pytest .warns (FutureWarning ,match = msgpattern ):
78
+ ct .config .defaults .update ({'config.oldkey' :6 })
79
+ with pytest .warns (FutureWarning ,match = msgpattern ):
80
+ assert ct .config .defaults .get ('config.oldkey' )== 6
81
+
76
82
with pytest .raises (KeyError ):
77
- with pytest .warns (DeprecationWarning ,match = msgpattern ):
83
+ with pytest .warns (FutureWarning ,match = msgpattern ):
78
84
ct .config .defaults ['config.oldmiss' ]
79
85
with pytest .raises (KeyError ):
80
86
ct .config .defaults ['config.neverdefined' ]
81
87
82
88
# assert that reset defaults keeps the custom type
83
89
ct .config .reset_defaults ()
84
- with pytest .warns (DeprecationWarning ,
90
+ with pytest .warns (FutureWarning ,
85
91
match = 'bode.* has been renamed to.*freqplot' ):
86
92
assert ct .config .defaults ['bode.Hz' ] \
87
93
== ct .config .defaults ['freqplot.Hz' ]