]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 18 Jun 2024 09:19:32 +0000 (12:19 +0300)
committerGitHub <noreply@github.com>
Tue, 18 Jun 2024 09:19:32 +0000 (12:19 +0300)
commit2cf47389e26cb591342d07dad98619916d5a1b15
tree9cae9fe3701eb521acb2fbf188aadc73f260987b
parentac37a806018cc40fafebcd0fa90250c3e0261e0c
gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615)

Mocking only works if sys.modules['pydoc'] and pydoc are the same,
but some pydoc functions reload the module and change sys.modules.
Ensure that sys.modules['pydoc'] is always restored after the corresponding
tests.
Lib/test/test_pydoc/test_pydoc.py