From b85ea2a7e3e62ed4109a4dc04eef77aafbc5f855 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 15 Feb 2022 09:40:48 -0300 Subject: [PATCH] Disable tracemalloc for test_resource_warning --- testing/test_warnings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 8b841d638..7b716bb45 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -789,6 +789,10 @@ def test_resource_warning(pytester: Pytester, monkeypatch: pytest.MonkeyPatch) - except ImportError: has_tracemalloc = False + # Explicitly disable PYTHONTRACEMALLOC in case pytest's test suite is running + # with it enabled. + monkeypatch.delenv("PYTHONTRACEMALLOC", raising=False) + pytester.makepyfile( """ def open_file(p):