1+ from datetime import datetime
2+ import platform
13from unittest .mock import MagicMock
24
35import matplotlib .pyplot as plt
4- from matplotlib .testing .decorators import image_comparison
6+ from matplotlib .testing .decorators import check_figures_equal , image_comparison
57import matplotlib .units as munits
68import numpy as np
7- import platform
89import pytest
910
1011
@@ -119,7 +120,6 @@ def test_empty_set_limits_with_units(quantity_converter):
119120@image_comparison (['jpl_bar_units.png' ],
120121 savefig_kwarg = {'dpi' : 120 }, style = 'mpl20' )
121122def test_jpl_bar_units ():
122- from datetime import datetime
123123 import matplotlib .testing .jpl_units as units
124124 units .register ()
125125
@@ -136,7 +136,6 @@ def test_jpl_bar_units():
136136@image_comparison (['jpl_barh_units.png' ],
137137 savefig_kwarg = {'dpi' : 120 }, style = 'mpl20' )
138138def test_jpl_barh_units ():
139- from datetime import datetime
140139 import matplotlib .testing .jpl_units as units
141140 units .register ()
142141
@@ -164,3 +163,12 @@ def test_scatter_element0_masked():
164163 fig , ax = plt .subplots ()
165164 ax .scatter (times , y )
166165 fig .canvas .draw ()
166+
167+
168+ @check_figures_equal (extensions = ["png" ])
169+ def test_subclass (fig_test , fig_ref ):
170+ class subdate (datetime ):
171+ pass
172+
173+ fig_test .subplots ().plot (subdate (2000 , 1 , 1 ), 0 , "o" )
174+ fig_ref .subplots ().plot (datetime (2000 , 1 , 1 ), 0 , "o" )
0 commit comments