From 10d87f29d0aad4b8921048da79f490134bd70c81 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Sun, 24 Sep 2023 11:19:27 -0700 Subject: [PATCH] TST: Don't call gc.collect for plotting tests --- pandas/tests/io/formats/style/test_matplotlib.py | 4 ---- pandas/tests/plotting/conftest.py | 4 ---- pandas/tests/plotting/frame/test_frame.py | 3 --- 3 files changed, 11 deletions(-) diff --git a/pandas/tests/io/formats/style/test_matplotlib.py b/pandas/tests/io/formats/style/test_matplotlib.py index fb7a77f1ddb27..058b225075e36 100644 --- a/pandas/tests/io/formats/style/test_matplotlib.py +++ b/pandas/tests/io/formats/style/test_matplotlib.py @@ -1,5 +1,3 @@ -import gc - import numpy as np import pytest @@ -33,8 +31,6 @@ def mpl_cleanup(): mpl_units.registry.clear() mpl_units.registry.update(orig_units_registry) plt.close("all") - # https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.6.0.html#garbage-collection-is-no-longer-run-on-figure-close # noqa: E501 - gc.collect(1) @pytest.fixture diff --git a/pandas/tests/plotting/conftest.py b/pandas/tests/plotting/conftest.py index d688bbd47595c..fb9fbfe674efe 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 @@ -25,8 +23,6 @@ def mpl_cleanup(): mpl_units.registry.clear() mpl_units.registry.update(orig_units_registry) plt.close("all") - # https://matplotlib.org/stable/users/prev_whats_new/whats_new_3.6.0.html#garbage-collection-is-no-longer-run-on-figure-close # noqa: E501 - gc.collect(1) @pytest.fixture diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 47114cab47619..606e22994e678 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -3,7 +3,6 @@ date, datetime, ) -import gc import itertools import re import string @@ -2050,8 +2049,6 @@ def test_memory_leak(self, kind): # have matplotlib delete all the figures plt.close("all") - # force a garbage collection - gc.collect() assert ref() is None def test_df_gridspec_patterns_vert_horiz(self):