mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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:
parent
5888107f33
commit
a1eaa74d9d
1 changed files with 2 additions and 1 deletions
|
@ -587,11 +587,12 @@ class TestRetrievingSourceCode(GetSourceBase):
|
||||||
|
|
||||||
class TestGetsourceInteractive(unittest.TestCase):
|
class TestGetsourceInteractive(unittest.TestCase):
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
mod.ParrotDroppings.__module__ = mod
|
mod.ParrotDroppings.__module__ = self.mod
|
||||||
sys.modules['__main__'] = self.main
|
sys.modules['__main__'] = self.main
|
||||||
|
|
||||||
def test_getclasses_interactive(self):
|
def test_getclasses_interactive(self):
|
||||||
self.main = sys.modules['__main__']
|
self.main = sys.modules['__main__']
|
||||||
|
self.mod = mod.ParrotDroppings.__module__
|
||||||
class MockModule:
|
class MockModule:
|
||||||
__file__ = None
|
__file__ = None
|
||||||
sys.modules['__main__'] = MockModule
|
sys.modules['__main__'] = MockModule
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue