File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def _draw(self):
43
43
44
44
def draw (self ):
45
45
# docstring inherited
46
- self .draw_idle ()
46
+ self ._draw ()
47
47
self .flush_events ()
48
48
49
49
# draw_idle is provided by _macosx.FigureCanvas
Original file line number Diff line number Diff line change
1
+ import pytest
2
+
3
+ import matplotlib .pyplot as plt
4
+
5
+
6
+ pytest .importorskip ("matplotlib.backends.backend_macosx" ,
7
+ reason = "These are mac only tests" )
8
+
9
+
10
+ @pytest .mark .backend ('macosx' )
11
+ def test_cached_renderer ():
12
+ # Make sure that figures have an associated renderer after
13
+ # a fig.canvas.draw() call
14
+ fig = plt .figure (1 )
15
+ fig .canvas .draw ()
16
+ assert fig ._cachedRenderer is not None
17
+
18
+ fig = plt .figure (2 )
19
+ fig .draw_without_rendering ()
20
+ assert fig ._cachedRenderer is not None
You can’t perform that action at this time.
0 commit comments