]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 2 Aug 2021 11:54:20 +0000 (12:54 +0100)
committerGitHub <noreply@github.com>
Mon, 2 Aug 2021 11:54:20 +0000 (13:54 +0200)
Lib/test/test_inspect.py

index a46dc9ba594dc4f48e1c0fffd5628dd31aa0a125..b0c42a2dcf6ce6771ea03f37b92377366b554c98 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