File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 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(
111111 Warnings stacklevel to provide; note that this will be incremented by
112112 1, so provide the stacklevel you would provide directly to warnings.warn()
113113 """
114- if cmp_pkg_version (version ) >= 0 :
114+ if cmp_pkg_version (version ) > 0 :
115115 msg = f'{ msg } This will error in NiBabel { version } . { warning_rec } '
116116 warnings .warn (msg .strip (), warning_class , stacklevel = stacklevel + 1 )
117117 else :
Original file line number Diff line number Diff line change @@ -109,3 +109,11 @@ def test_alert_future_error():
109109 error_rec = 'Fix this issue by doing XYZ.' ,
110110 error_class = ValueError ,
111111 )
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