File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -601,7 +601,9 @@ def _from_subplot_args(figure, args):
601601 else :
602602 if not isinstance (num , Integral ) or num < 1 or num > rows * cols :
603603 raise ValueError (
604- f"num must be 1 <= num <= { rows * cols } , not { num !r} " )
604+ f"num must be an integer with 1 <= num <= { rows * cols } , "
605+ f"not { num !r} "
606+ )
605607 i = j = num
606608 return gs [i - 1 :j ]
607609
Original file line number Diff line number Diff line change @@ -236,10 +236,15 @@ def test_add_subplot_invalid():
236236 with pytest .raises (ValueError ,
237237 match = 'Number of rows must be a positive integer' ):
238238 fig .add_subplot (0 , 2 , 1 )
239- with pytest .raises (ValueError , match = 'num must be 1 <= num <= 4' ):
239+ with pytest .raises (ValueError , match = 'num must be an integer with '
240+ '1 <= num <= 4' ):
240241 fig .add_subplot (2 , 2 , 0 )
241- with pytest .raises (ValueError , match = 'num must be 1 <= num <= 4' ):
242+ with pytest .raises (ValueError , match = 'num must be an integer with '
243+ '1 <= num <= 4' ):
242244 fig .add_subplot (2 , 2 , 5 )
245+ with pytest .raises (ValueError , match = 'num must be an integer with '
246+ '1 <= num <= 4' ):
247+ fig .add_subplot (2 , 2 , 0.5 )
243248
244249 with pytest .raises (ValueError , match = 'must be a three-digit integer' ):
245250 fig .add_subplot (42 )
You can’t perform that action at this time.
0 commit comments