]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120669)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 18 Jun 2024 09:54:55 +0000 (11:54 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Jun 2024 09:54:55 +0000 (09:54 +0000)
commit451cb71cc820cce5f250c507cecf15d34f181157
tree327376a0341bfcb3a82d5aad21d46c92bcab4ebe
parent71ad34d2190a1f16ac7dbc70b8bce8c6b2549109
[3.13] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120669)

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.
(cherry picked from commit 2cf47389e26cb591342d07dad98619916d5a1b15)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_pydoc/test_pydoc.py