@@ -908,19 +908,31 @@ def test_set_shape(shape):
908908 assert_array_equal (na , da )
909909
910910
911- def test_geomspace_zero_error ():
911+ @pytest .mark .parametrize (
912+ "start, stop, num" ,
913+ [
914+ (0 , 5 , 3 ),
915+ (2 , 0 , 3 ),
916+ (0 , 0 , 3 ),
917+ (dpnp .array ([0 ]), 7 , 10 ),
918+ (- 2 , numpy .array ([[0 ]]), 7 ),
919+ ([2 , 4 , 0 ], 3 , 5 ),
920+ ],
921+ )
922+ def test_geomspace_zero_error (start , stop , num ):
912923 with pytest .raises (ValueError ):
913- dpnp .geomspace (0 , 5 , 3 )
914- dpnp .geomspace (2 , 0 , 3 )
915- dpnp .geomspace (0 , 0 , 3 )
924+ dpnp .geomspace (start , stop , num )
916925
917926
918- def test_space_num_error ():
927+ @pytest .mark .parametrize ("xp" , [dpnp , numpy ])
928+ @pytest .mark .parametrize ("func" , ["geomspace" , "logspace" ])
929+ @pytest .mark .parametrize (
930+ "start, stop, num" ,
931+ [(2 , 5 , - 3 ), ([2 , 3 ], 5 , - 3 )],
932+ )
933+ def test_space_num_error (xp , func , start , stop , num ):
919934 with pytest .raises (ValueError ):
920- dpnp .geomspace (2 , 5 , - 3 )
921- dpnp .logspace (2 , 5 , - 3 )
922- dpnp .geomspace ([2 , 3 ], 5 , - 3 )
923- dpnp .logspace ([2 , 3 ], 5 , - 3 )
935+ getattr (xp , func )(start , stop , num )
924936
925937
926938@pytest .mark .parametrize ("sign" , [- 1 , 1 ])
0 commit comments