mirror of
https://github.com/python/cpython.git
synced 2025-08-10 03:49:18 +00:00
[3.12] gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680) (#116684)
gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680)
(cherry picked from commit a254807761
)
gh-116307: Create a new import helper 'isolated modules' and use that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
This commit is contained in:
parent
65c6620a3a
commit
f9d1ec8e80
3 changed files with 16 additions and 1 deletions
|
@ -70,7 +70,7 @@ class SiteDir:
|
|||
self.addCleanup(self.fixtures.close)
|
||||
self.site_dir = self.fixtures.enter_context(os_helper.temp_dir())
|
||||
self.fixtures.enter_context(import_helper.DirsOnSysPath(self.site_dir))
|
||||
self.fixtures.enter_context(import_helper.CleanImport())
|
||||
self.fixtures.enter_context(import_helper.isolated_modules())
|
||||
|
||||
|
||||
class ModulesFilesTests(SiteDir, unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue