]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-102978: Fix mock.patch function signatures for class and staticmethod decor...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 May 2023 10:47:12 +0000 (03:47 -0700)
committerGitHub <noreply@github.com>
Mon, 22 May 2023 10:47:12 +0000 (12:47 +0200)
commite95ca78fab1c9ef288fcca72da7404236ba072bd
tree3f563471215d137268dbb4922b0f1a1efbd21c77
parent1692a16a25e54696a42725fd35e14005492fc09f
[3.11] gh-102978: Fix mock.patch function signatures for class and staticmethod decorators (GH-103228) (#103499)

Fixes unittest.mock.patch not enforcing function signatures for methods
decorated with @classmethod or @staticmethod when patch is called with
autospec=True.

(cherry picked from commit 59e0de4903c02e72b329e505fddf1ad9794928bc)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Lib/unittest/mock.py
Lib/unittest/test/testmock/testhelpers.py
Lib/unittest/test/testmock/testpatch.py
Misc/ACKS
Misc/NEWS.d/next/Library/2023-04-03-23-44-34.gh-issue-102978.gy9eVk.rst [new file with mode: 0644]