New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-116307: Proper fix for 'mod' leaking across importlib tests #116680
gh-116307: Proper fix for 'mod' leaking across importlib tests #116680
Conversation
…e that instead of 'Clean Import' to ensure that tests from importlib_resources don't leave modules in sys.modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this!
Thanks @jaraco for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
…ythonGH-116680) (cherry picked from commit a254807) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> pythongh-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.
Sorry, @jaraco, I could not cleanly backport this to
|
GH-116684 is a backport of this pull request to the 3.12 branch. |
… tests (pythonGH-116680) (python#116684) pythongh-116307: Proper fix for 'mod' leaking across importlib tests (pythonGH-116680) (cherry picked from commit a254807) pythongh-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>
GH-116694 is a backport of this pull request to the 3.11 branch. |
#116694) [3.11] gh-116307: Proper fix for 'mod' leaking across importlib tests (GH-116680) (cherry picked from commit a254807) 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.
… tests (pythonGH-116680) (cherry picked from commit a254807) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com> pythongh-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.
Ironically, since this was merged, |
Example of leak:
|
…ython#116680) pythongh-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.
…ython#116680) pythongh-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.
…ython#116680) pythongh-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.
As discovered in #116307 (comment), addresses an issue in importlib.resources tests where a module imported for test can leak to other tests.