File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ def alert_future_error(
111
111
Warnings stacklevel to provide; note that this will be incremented by
112
112
1, so provide the stacklevel you would provide directly to warnings.warn()
113
113
"""
114
- if cmp_pkg_version (version ) >= 0 :
114
+ if cmp_pkg_version (version ) > 0 :
115
115
msg = f'{ msg } This will error in NiBabel { version } . { warning_rec } '
116
116
warnings .warn (msg .strip (), warning_class , stacklevel = stacklevel + 1 )
117
117
else :
Original file line number Diff line number Diff line change @@ -109,3 +109,11 @@ def test_alert_future_error():
109
109
error_rec = 'Fix this issue by doing XYZ.' ,
110
110
error_class = ValueError ,
111
111
)
112
+ with pytest .raises (ValueError ):
113
+ alert_future_error (
114
+ 'Message' ,
115
+ '2.0.0' , # Error if we equal the (patched) version
116
+ warning_rec = 'Silence this warning by doing XYZ.' ,
117
+ error_rec = 'Fix this issue by doing XYZ.' ,
118
+ error_class = ValueError ,
119
+ )
You can’t perform that action at this time.
0 commit comments