@@ -385,15 +385,27 @@ def test_trunc_shapes_invalid(invdtypes: dtype.Dtype) -> None:
385385 (random .randint (1 , 10 ), random .randint (1 , 10 ), random .randint (1 , 10 ), random .randint (1 , 10 )),
386386 ],
387387)
388- @pytest .mark .parametrize ("dtype_name" , util .get_all_types ())
389- def test_hypot_shape_dtypes (shape : tuple , dtype_name : dtype .Dtype ) -> None :
388+ def test_hypot_shape_dtypes (shape : tuple ) -> None :
390389 """Test hypotenuse operation between two arrays of the same shape"""
391- util .check_type_supported (dtype_name )
392- lhs = wrapper .randu (shape , dtype_name )
393- rhs = wrapper .randu (shape , dtype_name )
390+ lhs = wrapper .randu (shape , dtype .f32 )
391+ rhs = wrapper .randu (shape , dtype .f32 )
394392
395- result = wrapper .hypot (lhs , rhs )
393+ result = wrapper .hypot (lhs , rhs , True )
396394
397395 assert (
398396 wrapper .get_dims (result )[0 : len (shape )] == shape # noqa
399- ), f"failed for shape: { shape } and dtype { dtype_name } "
397+ ), f"failed for shape: { shape } and dtype { dtype .f32 } "
398+ @pytest .mark .parametrize (
399+ "invdtypes" ,
400+ [
401+ dtype .int32 ,
402+ dtype .uint32 ,
403+ ],
404+ )
405+ def test_hypot_unsupported_dtypes (invdtypes : dtype .Dtype ) -> None :
406+ """Test division operation for unsupported data types."""
407+ with pytest .raises (RuntimeError ):
408+ shape = (5 , 5 )
409+ lhs = wrapper .randu (shape , invdtypes )
410+ rhs = wrapper .randu (shape , invdtypes )
411+ wrapper .hypot (rhs , lhs , True )
0 commit comments