@@ -1243,13 +1243,13 @@ def test_legend_labelcolor_linecolor_plot():
12431243 p = ax .plot (x , 'o' , c = 'none' , mec = 'none' , label = "invisible circles and label" )
12441244 leg = ax .legend (labelcolor = 'linecolor' )
12451245 tc = leg .texts [0 ].get_color ()
1246- assert tc == 'none'
1247- assert tc == leg .get_lines ()[0 ].get_markerfacecolor ()
1248- assert tc == leg .get_lines ()[0 ].get_markeredgecolor ()
1249- assert tc == leg .get_lines ()[0 ].get_color ()
1250- assert tc == p [0 ].get_markerfacecolor ()
1251- assert tc == p [0 ].get_markeredgecolor ()
1252- assert tc == p [0 ].get_color ()
1246+ assert mpl . colors . same_color ( tc , 'none' )
1247+ assert mpl . colors . same_color ( tc , leg .get_lines ()[0 ].get_markerfacecolor () )
1248+ assert mpl . colors . same_color ( tc , leg .get_lines ()[0 ].get_markeredgecolor () )
1249+ assert mpl . colors . same_color ( tc , leg .get_lines ()[0 ].get_color () )
1250+ assert mpl . colors . same_color ( tc , p [0 ].get_markerfacecolor () )
1251+ assert mpl . colors . same_color ( tc , p [0 ].get_markeredgecolor () )
1252+ assert mpl . colors . same_color ( tc , p [0 ].get_color () )
12531253 plt .close ('all' )
12541254
12551255
@@ -1302,7 +1302,7 @@ def test_legend_labelcolor_linecolor_scatter():
13021302 p = ax .scatter (x , x , c = 'none' , ec = 'none' , label = "invisible circles and label" )
13031303 leg = ax .legend (labelcolor = 'linecolor' )
13041304 tc = leg .texts [0 ].get_color ()
1305- assert tc == 'none'
1305+ assert mpl . colors . same_color ( tc , 'none' )
13061306 plt .close ('all' )
13071307
13081308
0 commit comments