Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit30ebdf9

Browse files
committed
TST: explicitly close the all the figures after each test
1 parent3eeb476 commit30ebdf9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎lib/matplotlib/testing/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ def mpl_test_settings(request):
5454
style,=style_marker.args
5555

5656
matplotlib.testing.setup()
57+
# This import must come after setup() so it doesn't load the
58+
# default backend prematurely.
59+
importmatplotlib.pyplotasplt
5760
ifbackendisnotNone:
58-
# This import must come after setup() so it doesn't load the
59-
# default backend prematurely.
60-
importmatplotlib.pyplotasplt
6161
try:
6262
plt.switch_backend(backend)
6363
exceptImportErrorasexc:
@@ -73,10 +73,12 @@ def mpl_test_settings(request):
7373
try:
7474
yield
7575
finally:
76+
plt.close('all')
7677
ifbackendisnotNone:
7778
plt.switch_backend(prev_backend)
7879

7980

81+
8082
@pytest.fixture
8183
defmpl_image_comparison_parameters(request,extension):
8284
# This fixture is applied automatically by the image_comparison decorator.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp