From 9fcf5abf3cc49693c144393ed7102567bdf39668 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:23:32 -0700 Subject: [PATCH 1/3] TST: Reduce memory pressure of plotting tests --- pandas/tests/plotting/conftest.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pandas/tests/plotting/conftest.py b/pandas/tests/plotting/conftest.py index aa9952db17b74..44b8a7c3d3f27 100644 --- a/pandas/tests/plotting/conftest.py +++ b/pandas/tests/plotting/conftest.py @@ -1,3 +1,5 @@ +import gc + import numpy as np import pytest @@ -7,6 +9,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") @@ -16,9 +25,13 @@ 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") + gc.collect() @pytest.fixture From 50a67fe7242aaad09c2f42bcfb402d147de1f41b Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 14 Jun 2023 14:01:24 -0700 Subject: [PATCH 2/3] Trigger ci From b26204abd9a634fbc92bc71d8f9669b84e0b53f2 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 20 Jun 2023 17:48:43 -0700 Subject: [PATCH 3/3] Remove gc call --- pandas/tests/plotting/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pandas/tests/plotting/conftest.py b/pandas/tests/plotting/conftest.py index 44b8a7c3d3f27..6f77356eb3762 100644 --- a/pandas/tests/plotting/conftest.py +++ b/pandas/tests/plotting/conftest.py @@ -1,5 +1,3 @@ -import gc - import numpy as np import pytest @@ -31,7 +29,6 @@ def close_all_figures(): plt.cla() plt.clf() plt.close("all") - gc.collect() @pytest.fixture