From adc4b124fc57cc3864bf68c61f7fa046757ffa02 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 20 Mar 2024 13:55:54 -0400 Subject: [PATCH] Ensure tests do not leak references in sys.modules. --- tests/fixtures.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fixtures.py b/tests/fixtures.py index 07f10963..f8082df0 100644 --- a/tests/fixtures.py +++ b/tests/fixtures.py @@ -9,6 +9,7 @@ import functools import contextlib +from .compat.py312 import import_helper from .compat.py39 import os_helper from . import _path @@ -84,6 +85,7 @@ def add_sys_path(dir): def setUp(self): super().setUp() self.fixtures.enter_context(self.add_sys_path(self.site_dir)) + self.fixtures.enter_context(import_helper.isolated_modules()) class SiteBuilder(SiteDir):