Skip to content

Commit 2041588

Browse files
authored
Close figures in tests (#262)
1 parent 3fbb336 commit 2041588

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

tests/plotting/test_style.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def save_plot(filepath):
1515
fig, ax = plt.subplots()
1616
ax.plot([0, 1])
1717
fig.savefig(filepath)
18+
plt.close()
1819

1920

2021
@pytest.mark.parametrize('as_decorator', [False, True])

tests/shapes/test_factory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test the factory module."""
22

3+
import matplotlib.pyplot as plt
34
import pytest
45

56

@@ -41,3 +42,4 @@ def test_plot_available_shapes(self, shape_factory, monkeypatch, subset):
4142
assert {ax.get_title() for ax in populated_axs} == set(
4243
shape_factory.AVAILABLE_SHAPES
4344
)
45+
plt.close()

0 commit comments

Comments
 (0)