bpo-44808: Fix test_inspect in refleak mode (GH-27544)

(cherry picked from commit 626d397cc1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-08-02 06:41:08 -07:00 committed by GitHub
parent 5888107f33
commit a1eaa74d9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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