From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 2 Aug 2021 13:41:08 +0000 (-0700) Subject: bpo-44808: Fix test_inspect in refleak mode (GH-27544) X-Git-Tag: v3.10.0rc1~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a1eaa74d9dcd973ec278cefc22aac7f514faee4b;p=thirdparty%2FPython%2Fcpython.git bpo-44808: Fix test_inspect in refleak mode (GH-27544) (cherry picked from commit 626d397cc1612ea5eef153dd910834c2ee00ddbd) Co-authored-by: Pablo Galindo Salgado --- diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index b664c14020f3..157f315999c4 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -587,11 +587,12 @@ class TestRetrievingSourceCode(GetSourceBase): class TestGetsourceInteractive(unittest.TestCase): def tearDown(self): - mod.ParrotDroppings.__module__ = mod + mod.ParrotDroppings.__module__ = self.mod sys.modules['__main__'] = self.main def test_getclasses_interactive(self): self.main = sys.modules['__main__'] + self.mod = mod.ParrotDroppings.__module__ class MockModule: __file__ = None sys.modules['__main__'] = MockModule