@@ -324,7 +324,7 @@ def test_line_colors(self):
324324 ax2 = df .plot (color = custom_colors )
325325 lines2 = ax2 .get_lines ()
326326
327- for l1 , l2 in zip (ax .get_lines (), lines2 ):
327+ for l1 , l2 in zip (ax .get_lines (), lines2 , strict = True ):
328328 assert l1 .get_color () == l2 .get_color ()
329329
330330 @pytest .mark .parametrize ("colormap" , ["jet" , cm .jet ])
@@ -380,7 +380,7 @@ def test_line_colors_and_styles_subplots_custom_colors(self, color):
380380 # GH 9894
381381 df = DataFrame (np .random .default_rng (2 ).standard_normal ((5 , 5 )))
382382 axes = df .plot (color = color , subplots = True )
383- for ax , c in zip (axes , list (color )):
383+ for ax , c in zip (axes , list (color ), strict = True ):
384384 _check_colors (ax .get_lines (), linecolors = [c ])
385385
386386 def test_line_colors_and_styles_subplots_colormap_hex (self ):
@@ -389,7 +389,7 @@ def test_line_colors_and_styles_subplots_colormap_hex(self):
389389 # GH 10299
390390 custom_colors = ["#FF0000" , "#0000FF" , "#FFFF00" , "#000000" , "#FFFFFF" ]
391391 axes = df .plot (color = custom_colors , subplots = True )
392- for ax , c in zip (axes , list (custom_colors )):
392+ for ax , c in zip (axes , list (custom_colors ), strict = True ):
393393 _check_colors (ax .get_lines (), linecolors = [c ])
394394
395395 @pytest .mark .parametrize ("cmap" , ["jet" , cm .jet ])
@@ -398,7 +398,7 @@ def test_line_colors_and_styles_subplots_colormap_subplot(self, cmap):
398398 df = DataFrame (np .random .default_rng (2 ).standard_normal ((5 , 5 )))
399399 rgba_colors = [cm .jet (n ) for n in np .linspace (0 , 1 , len (df ))]
400400 axes = df .plot (colormap = cmap , subplots = True )
401- for ax , c in zip (axes , rgba_colors ):
401+ for ax , c in zip (axes , rgba_colors , strict = True ):
402402 _check_colors (ax .get_lines (), linecolors = [c ])
403403
404404 def test_line_colors_and_styles_subplots_single_col (self ):
@@ -423,7 +423,7 @@ def test_line_colors_and_styles_subplots_list_styles(self):
423423 # list of styles
424424 styles = list ("rgcby" )
425425 axes = df .plot (style = styles , subplots = True )
426- for ax , c in zip (axes , styles ):
426+ for ax , c in zip (axes , styles , strict = True ):
427427 _check_colors (ax .get_lines (), linecolors = [c ])
428428
429429 def test_area_colors (self ):
@@ -551,7 +551,7 @@ def test_kde_colors_and_styles_subplots_custom_color(self):
551551 df = DataFrame (np .random .default_rng (2 ).standard_normal ((5 , 5 )))
552552 custom_colors = "rgcby"
553553 axes = df .plot (kind = "kde" , color = custom_colors , subplots = True )
554- for ax , c in zip (axes , list (custom_colors )):
554+ for ax , c in zip (axes , list (custom_colors ), strict = True ):
555555 _check_colors (ax .get_lines (), linecolors = [c ])
556556
557557 @pytest .mark .parametrize ("colormap" , ["jet" , cm .jet ])
@@ -560,7 +560,7 @@ def test_kde_colors_and_styles_subplots_cmap(self, colormap):
560560 df = DataFrame (np .random .default_rng (2 ).standard_normal ((5 , 5 )))
561561 rgba_colors = [cm .jet (n ) for n in np .linspace (0 , 1 , len (df ))]
562562 axes = df .plot (kind = "kde" , colormap = colormap , subplots = True )
563- for ax , c in zip (axes , rgba_colors ):
563+ for ax , c in zip (axes , rgba_colors , strict = True ):
564564 _check_colors (ax .get_lines (), linecolors = [c ])
565565
566566 def test_kde_colors_and_styles_subplots_single_col (self ):
@@ -586,7 +586,7 @@ def test_kde_colors_and_styles_subplots_list(self):
586586 # list of styles
587587 styles = list ("rgcby" )
588588 axes = df .plot (kind = "kde" , style = styles , subplots = True )
589- for ax , c in zip (axes , styles ):
589+ for ax , c in zip (axes , styles , strict = True ):
590590 _check_colors (ax .get_lines (), linecolors = [c ])
591591
592592 def test_boxplot_colors (self ):
@@ -715,7 +715,7 @@ def test_colors_of_columns_with_same_name(self):
715715 result = df_concat .plot ()
716716 legend = result .get_legend ()
717717 handles = legend .legend_handles
718- for legend , line in zip (handles , result .lines ):
718+ for legend , line in zip (handles , result .lines , strict = True ):
719719 assert legend .get_color () == line .get_color ()
720720
721721 def test_invalid_colormap (self ):
0 commit comments