Skip to content

TST: Reduce memory pressure of plotting tests #53660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 21, 2023
10 changes: 10 additions & 0 deletions pandas/tests/plotting/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
)


@pytest.fixture(autouse=True)
def non_interactive():
mpl = pytest.importorskip("matplotlib")
mpl.use("template")
yield


@pytest.fixture(autouse=True)
def reset_rcParams():
mpl = pytest.importorskip("matplotlib")
Expand All @@ -16,8 +23,11 @@ def reset_rcParams():

@pytest.fixture(autouse=True)
def close_all_figures():
# https://stackoverflow.com/q/31156578
yield
plt = pytest.importorskip("matplotlib.pyplot")
plt.cla()
plt.clf()
plt.close("all")


Expand Down