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 … · python/cpython@14fbd4e · GitHub

/ cpython Public

Commit 14fbd4e

Browse files
gh-107446: Fix test_inspect.test_class_with_method_from_other_module when ran multiple times (#107451)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
1 parent ed4a978 commit 14fbd4e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Lib/test/test_inspect.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,9 @@ def f(self):
990990
with DirsOnSysPath(tempdir):
991991
import inspect_actual
992992
self.assertIn("correct", inspect.getsource(inspect_actual.A))
993+
# Remove the module from sys.modules to force it to be reloaded.
994+
# This is necessary when the test is run multiple times.
995+
sys.modules.pop("inspect_actual")
993996

994997
@unittest.skipIf(
995998
support.is_emscripten or support.is_wasi,

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL