]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 11 Apr 2020 07:59:24 +0000 (10:59 +0300)
committerGitHub <noreply@github.com>
Sat, 11 Apr 2020 07:59:24 +0000 (10:59 +0300)
commit4b222c9491d1700e9bdd98e6889b8d0ea1c7321e
tree65a24b8ad8fa5a39de328107f276e4ee224c204c
parentcd8295ff758891f21084a6a5ad3403d35dda38f7
bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351)

Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.
Lib/unittest/mock.py
Lib/unittest/test/testmock/testpatch.py
Misc/NEWS.d/next/Library/2020-04-04-00-47-40.bpo-40126.Y-bTNP.rst [new file with mode: 0644]