diff options
| author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-08-02 12:54:20 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-02 13:54:20 +0200 |
| commit | 626d397cc1612ea5eef153dd910834c2ee00ddbd (patch) | |
| tree | 5b949828ca9bdb23a550268a4afb3da30dbfbd2d /Lib/test/test_inspect.py | |
| parent | 414dcb13aaa4fd42f264fdee47782dede5c83d6c (diff) | |
| download | cpython-git-626d397cc1612ea5eef153dd910834c2ee00ddbd.tar.gz | |
bpo-44808: Fix test_inspect in refleak mode (GH-27544)
Diffstat (limited to 'Lib/test/test_inspect.py')
| -rw-r--r-- | Lib/test/test_inspect.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index a46dc9ba59..b0c42a2dcf 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 |
