]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-36871: Ensure method signature is used when asserting mock calls to a method...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 29 Aug 2019 06:57:37 +0000 (23:57 -0700)
committerChris Withers <chris@withers.org>
Thu, 29 Aug 2019 06:57:37 +0000 (07:57 +0100)
commitbe310e03d0b84ef56e9d35b0b1b21d685b7ea371
tree3726190b63e8f3f3901c86c60e525d8c640357fb
parent409493d0acdb8dec55868bb5c6af427ce31ff555
bpo-36871: Ensure method signature is used when asserting mock calls to a method (GH15577)

* Fix call_matcher for mock when using methods

* Add NEWS entry

* Use None check and convert doctest to unittest

* Use better name for mock in tests. Handle _SpecState when the attribute was not accessed and add tests.

* Use reset_mock instead of reinitialization. Change inner class constructor signature for check

* Reword comment regarding call object lookup logic
(cherry picked from commit c96127821ebda50760e788b1213975a0d5bea37f)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
Lib/unittest/mock.py
Lib/unittest/test/testmock/testmock.py
Misc/NEWS.d/next/Library/2019-05-12-12-58-37.bpo-36871.6xiEHZ.rst [new file with mode: 0644]