File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ def __repr__(self):
224224 def __setattr__ (self , name , value ):
225225 if name in self .deprecated_options :
226226 level = self .deprecated_options [name ]
227- if level == 'error' :
227+ if level == 'error' and not value :
228228 emsg = ("setting the 'Future' property {prop!r} has been "
229229 "deprecated to be removed in a future release, and "
230230 "deprecated {prop!r} behaviour has been removed. "
Original file line number Diff line number Diff line change @@ -43,22 +43,17 @@ def test_invalid_attribute(self):
4343 with self .assertRaises (AttributeError ):
4444 future .numberwang = 7
4545
46- def test_invalid_netcdf_promote_attributes (self ):
46+ def test_netcdf_promote (self ):
4747 future = Future ()
48- states = [True , False ]
49- exp_emsg = "deprecated 'netcdf_promote' behaviour has been removed"
50- for state in states :
51- with self .assertRaisesRegexp (AttributeError , exp_emsg ):
52- future .netcdf_promote = state
48+ exp_emsg = "'Future' property 'netcdf_promote' is deprecated"
49+ with self .assertWarnsRegexp (exp_emsg ):
50+ future .netcdf_promote = True
5351
54- def test_invalid_netcdf_no_unlimited_attributes (self ):
52+ def test_invalid_netcdf_promote (self ):
5553 future = Future ()
56- states = [True , False ]
57- exp_emsg = \
58- "deprecated 'netcdf_no_unlimited' behaviour has been removed"
59- for state in states :
60- with self .assertRaisesRegexp (AttributeError , exp_emsg ):
61- future .netcdf_no_unlimited = state
54+ exp_emsg = "'Future' property 'netcdf_promote' has been deprecated"
55+ with self .assertRaisesRegexp (AttributeError , exp_emsg ):
56+ future .netcdf_promote = False
6257
6358 def test_cell_datetime_objects (self ):
6459 future = Future ()
You can’t perform that action at this time.
0 commit comments