@@ -58,26 +58,35 @@ def test_get_scaling():
5858
5959 # list or tuple tests
6060 # total_size contains other than Ellipsis, None and Int
61- with pytest .raises (TypeError ):
61+ with pytest .raises (TypeError , match = "Unrecognized `total_size` type" ):
6262 _get_scaling ([2 , 4 , 5 , 9 , 11.5 ], (2 , 3 ), 2 )
6363 # check with Ellipsis
64- with pytest .raises (ValueError ):
64+ with pytest .raises (ValueError , match = "Double Ellipsis in `total_size` is restricted" ):
6565 _get_scaling ([1 , 2 , 5 , Ellipsis , Ellipsis ], (2 , 3 ), 2 )
66- with pytest .raises (ValueError ):
66+ with pytest .raises (
67+ ValueError ,
68+ match = "Length of `total_size` is too big, number of scalings is bigger that ndim" ,
69+ ):
6770 _get_scaling ([1 , 2 , 5 , Ellipsis ], (2 , 3 ), 2 )
6871
6972 assert _get_scaling ([Ellipsis ], (2 , 3 ), 2 ).eval () == 1
7073
7174 assert _get_scaling ([4 , 5 , 9 , Ellipsis , 32 , 12 ], (2 , 3 , 2 ), 5 ).eval () == 960
7275 assert _get_scaling ([4 , 5 , 9 , Ellipsis ], (2 , 3 , 2 ), 5 ).eval () == 15
7376 # total_size with no Ellipsis (end = [ ])
74- with pytest .raises (ValueError ):
77+ with pytest .raises (
78+ ValueError ,
79+ match = "Length of `total_size` is too big, number of scalings is bigger that ndim" ,
80+ ):
7581 _get_scaling ([1 , 2 , 5 ], (2 , 3 ), 2 )
7682
7783 assert _get_scaling ([], (2 , 3 ), 2 ).eval () == 1
7884 assert _get_scaling ((), (2 , 3 ), 2 ).eval () == 1
7985 # total_size invalid type
80- with pytest .raises (TypeError ):
86+ with pytest .raises (
87+ TypeError ,
88+ match = "Unrecognized `total_size` type, expected int or list of ints, got {1, 2, 5}" ,
89+ ):
8190 _get_scaling ({1 , 2 , 5 }, (2 , 3 ), 2 )
8291
8392 # test with rvar from model graph
0 commit comments