]> git.ipfire.org Git - thirdparty/Python/cpython.git/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 08:04:07 +0000 (01:04 -0700)
committerChris Withers <chris@withers.org>
Mon, 22 Jul 2019 08:04:07 +0000 (09:04 +0100)
commite9b187a2bfbb0586fc5d554ce745b7fe04e0b9a8
treea2d1092d90ab8ca06ab2cb0ad56ba32841a9a2a4
parent849a37a2b640af14cfb004cdbced01983b0d9d2b
bpo-21478: Record calls to parent when autospecced objects are used as child with attach_mock (GH 14688) (GH-14903)

* 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]