]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 2 Aug 2021 13:41:08 +0000 (06:41 -0700)
committerGitHub <noreply@github.com>
Mon, 2 Aug 2021 13:41:08 +0000 (06:41 -0700)
(cherry picked from commit 626d397cc1612ea5eef153dd910834c2ee00ddbd)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Lib/test/test_inspect.py

index b664c14020f35eab42339a519282ff3aed78545f..157f315999c428c3b7b6cd67dc75f7799c812c1b 100644 (file)
@@ -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