8000 gh-107446: Fix test_inspect.test_class_with_method_from_other_module under --forever by gaogaotiantian · Pull Request #107451 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

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
merged 5 commits into from
Aug 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Lib/test/test_inspect.py
  • Loading branch information
kumaraditya303 authored Aug 3, 2023
commit a17c5f06b844fd42b0576c70698f1b096a492557
6 changes: 2 additions & 4 deletions Lib/test/test_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,8 @@ def f(self):
with DirsOnSysPath(tempdir):
import inspect_actual
self.assertIn("correct", inspect.getsource(inspect_actual.A))
# --forever will run this test multiple times, each time the test
# executes, we create a different temporary directory, and the old
# one is removed. So we need to remove the module from sys.modules
# to force it to be reloaded.
# Remove the module from sys.modules to force it to be reloaded.
# This is necessary when the test is run multiple times.
sys.modules.pop("inspect_actual")

@unittest.skipIf(
Expand Down
0