FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-107446: Fix test_inspect.test_class_with_method_from_other_module under --forever by gaogaotiantian · Pull Request #107451 · python/cpython · GitHub

/ cpython Public

gh-107446: Fix test_inspect.test_class_with_method_from_other_module under --forever - #107451

Merged
kumaraditya303 merged 5 commits into
python:mainfrom
gaogaotiantian:fix-test-inspect
Aug 3, 2023
Merged

kumaraditya303 merged 5 commits into
python:mainfrom
gaogaotiantian:fix-test-inspect

Conversation

gaogaotiantian commented Jul 29, 2023 •
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

The test creates a temporary directory to store the modules every time it executes. However, with --forever, the test will run more than once. When the old directory got removed, the cached module would lost source. In order to fix this, we can simply remove the module from sys.modules and force the module to be reloaded every time.

Eclips4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the fix!
Just FYI, I've found it via running refleak tests with 3:3 option. Probably, it's has the same mechanism of running tests as the --forever parameter.

Comment thread Lib/test/test_inspect.py Outdated
Comment thread Lib/test/test_inspect.py Outdated
kumaraditya303 enabled auto-merge (squash) August 3, 2023 14:36
kumaraditya303 merged commit 14fbd4e into python:main Aug 3, 2023
gaogaotiantian deleted the fix-test-inspect branch August 3, 2023 17:31
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL