File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,10 @@ def cant_convert(v):
300300 assert noconvert (7 ) == 7
301301 cant_convert (3.14159 )
302302 # TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
303- with pytest .deprecated_call ():
303+ if env .PY >= (3 , 8 ):
304+ with pytest .deprecated_call ():
305+ assert convert (Int ()) == 42
306+ else :
304307 assert convert (Int ()) == 42
305308 requires_conversion (Int ())
306309 cant_convert (NotInt ())
@@ -332,7 +335,10 @@ def require_implicit(v):
332335
333336 # The implicit conversion from np.float32 is undesirable but currently accepted.
334337 # TODO: Avoid DeprecationWarning in `PyLong_AsLong` (and similar)
335- with pytest .deprecated_call ():
338+ if env .PY >= (3 , 8 ):
339+ with pytest .deprecated_call ():
340+ assert convert (np .float32 (3.14159 )) == 3
341+ else :
336342 assert convert (np .float32 (3.14159 )) == 3
337343 require_implicit (np .float32 (3.14159 ))
338344
You can’t perform that action at this time.
0 commit comments