File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ def mpl_test_settings(request):
54
54
style , = style_marker .args
55
55
56
56
matplotlib .testing .setup ()
57
+ # This import must come after setup() so it doesn't load the
58
+ # default backend prematurely.
59
+ import matplotlib .pyplot as plt
57
60
if backend is not None :
58
- # This import must come after setup() so it doesn't load the
59
- # default backend prematurely.
60
- import matplotlib .pyplot as plt
61
61
try :
62
62
plt .switch_backend (backend )
63
63
except ImportError as exc :
@@ -73,10 +73,12 @@ def mpl_test_settings(request):
73
73
try :
74
74
yield
75
75
finally :
76
+ plt .close ('all' )
76
77
if backend is not None :
77
78
plt .switch_backend (prev_backend )
78
79
79
80
81
+
80
82
@pytest .fixture
81
83
def mpl_image_comparison_parameters (request , extension ):
82
84
# This fixture is applied automatically by the image_comparison decorator.
You can’t perform that action at this time.
0 commit comments