]> granicus.if.org Git - python/commit
bpo-36366: Return None on stopping unstarted patch object (GH-12472)
authorXtreak <tir.karthi@gmail.com>
Thu, 28 Mar 2019 21:08:43 +0000 (02:38 +0530)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 28 Mar 2019 21:08:43 +0000 (14:08 -0700)
commit02b84cb1b4f5407309c81c8b1ae0397355d6e568
treec7faa3554711f2a97b71c53699b19fb2f7f4581d
parent3d78c4a6e5ae91eaf337b6f5cc6e8bb01af7c7b1
bpo-36366: Return None on stopping unstarted patch object (GH-12472)

Return None after calling unittest.mock.patch.object.stop() regardless of whether the object was started. This makes the method idempotent.

https://bugs.python.org/issue36366
Lib/unittest/mock.py
Lib/unittest/test/testmock/testpatch.py
Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst [new file with mode: 0644]