summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-08-02 13:41:08 (GMT)
committerGitHub <noreply@github.com>2021-08-02 13:41:08 (GMT)
commita1eaa74d9dcd973ec278cefc22aac7f514faee4b (patch)
treecf0a5eb03e3a89e370d71d2dd176a8eff2ab5938
parent5888107f330fe0153075924b48b780372e08fe10 (diff)
downloadcpython-a1eaa74d9dcd973ec278cefc22aac7f514faee4b.zip
cpython-a1eaa74d9dcd973ec278cefc22aac7f514faee4b.tar.gz
cpython-a1eaa74d9dcd973ec278cefc22aac7f514faee4b.tar.bz2
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
(cherry picked from commit 626d397cc1612ea5eef153dd910834c2ee00ddbd) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
-rw-r--r--Lib/test/test_inspect.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index b664c14..157f315 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