]> granicus.if.org Git - python/commit
bpo-21478: Record calls to parent when autospecced objects are used as child with...
authorXtreak <tir.karthi@gmail.com>
Mon, 22 Jul 2019 07:38:22 +0000 (13:08 +0530)
committerChris Withers <chris@withers.org>
Mon, 22 Jul 2019 07:38:22 +0000 (08:38 +0100)
commit7397cda99795a4a8d96193d710105e77a07b7411
tree476ce4e60fbe1ffbdf40cf754b506bfa2deeafab
parentb530a4460b7a6ea96f1fa81a7c5bb529ead574ef
bpo-21478: Record calls to parent when autospecced objects are used as child with attach_mock (GH 14688)

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