]> granicus.if.org Git - python/commit
bpo-21478: Record calls to parent when autospecced objects are used as child with...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 22 Jul 2019 07:59:00 +0000 (00:59 -0700)
committerChris Withers <chris@withers.org>
Mon, 22 Jul 2019 07:59:00 +0000 (08:59 +0100)
commit22fd679dc363bfcbda336775da16aff4d6fcb33f
tree65c79998fdff2daf44568b665a1a7b40e53da384
parent24b5b360faf306ef67419dfe5d49ff22dbe827b1
bpo-21478: Record calls to parent when autospecced objects are used as child with attach_mock (GH 14688) (GH-14902)

* Clear name and parent of mock in autospecced objects used with attach_mock

* Add NEWS entry

* Fix reversed order of comparison

* Test child and standalone function calls

* Use a helper function extracting mock to avoid code duplication and refactor tests.
(cherry picked from commit 7397cda99795a4a8d96193d710105e77a07b7411)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
Lib/unittest/mock.py
Lib/unittest/test/testmock/testmock.py
Misc/NEWS.d/next/Library/2019-07-10-23-07-11.bpo-21478.cCw9rF.rst [new file with mode: 0644]