Skip to content

Commit cc41508

Browse files
Close plots in tests
1 parent 2bfc7a6 commit cc41508

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/post/test_post.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_save_plot(example_section, tmp_path):
5858
d.mkdir()
5959

6060
sec.plot_mesh(filename=d / "fig.png")
61+
plt.close("all")
6162

6263

6364
def test_supplied_axis(example_section):
@@ -66,17 +67,22 @@ def test_supplied_axis(example_section):
6667
_, ax = plt.subplots()
6768

6869
sec.plot_mesh(ax=ax, render=False)
70+
plt.close("all")
6971
sec.plot_mesh(nrows=2, axis_index=1, render=False)
72+
plt.close("all")
7073

7174
with pytest.raises(ValueError, match="is not compatible"):
72-
sec.plot_mesh(nrows=2, ncols=2, axis_index=5)
75+
sec.plot_mesh(nrows=2, ncols=2, axis_index=5, render=False)
76+
77+
plt.close("all")
7378

7479

7580
def test_plot_centroids(example_section):
7681
"""Tests plotting centroids."""
7782
sec = example_section
7883
sec.calculate_geometric_properties()
7984
sec.plot_centroids(render=False)
85+
plt.close("all")
8086

8187

8288
def test_print_results(example_section):

0 commit comments

Comments
 (0)