-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-108927: Fix removing testing modules from sys.modules #108952
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
Merged
serhiy-storchaka
merged 20 commits into
python:main
from
serhiy-storchaka:regretest-no-remove-test-module
Dec 4, 2023
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
339f260
gh-108927: Do not remove tested modules from sys.modules
serhiy-storchaka e52be9b
Update NEWS entry.
serhiy-storchaka 68c014e
Fix unloading the newly imported modules after testing.
serhiy-storchaka c1ad70c
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 3f25ab4
Add tests.
serhiy-storchaka 7673248
Update Misc/NEWS.d/next/Tests/2023-09-05-20-46-35.gh-issue-108927.Tpw…
serhiy-storchaka 5df4c8b
Move save/unload modules down in single.py.
serhiy-storchaka eb7766b
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 0eae535
Refactoring.
serhiy-storchaka 66437b5
Remove also attributes from parent modules.
serhiy-storchaka 8470b33
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 544c068
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 1e7ea34
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 56621ab
Only unload modules if run tests sequentially.
serhiy-storchaka ba5597a
Apply suggestions from code review
serhiy-storchaka d025e22
Merge branch 'main' into regretest-no-remove-test-module
serhiy-storchaka 1aae341
Add a comment.
serhiy-storchaka 017f01d
Test that test modules are really unloaded.
serhiy-storchaka 5086405
Merge remote-tracking branch 'refs/remotes/origin/regretest-no-remove…
serhiy-storchaka b3ea8fa
Update Lib/test/test_regrtest.py
serhiy-storchaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Tests/2023-09-05-20-46-35.gh-issue-108927.TpwWav.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Fixed failure for tests running sequentially in the same process when | ||
| test_importlib occurs between two other tests that use test_importlib.util. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hum. I think that the problem is that only a single module is unload from sys.modules.
If we want to save/restore modules, IMO the whole
sys.modulesdictionary must be saved/restored. Not a single entry.Would it make sense to save/restore the whole sys.modules dict? Would it fix #108927 ?