diff options
author | Xtreak <tir.karthi@gmail.com> | 2019-03-28 21:08:43 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-03-28 21:08:43 (GMT) |
commit | 02b84cb1b4f5407309c81c8b1ae0397355d6e568 (patch) | |
tree | c7faa3554711f2a97b71c53699b19fb2f7f4581d /Misc | |
parent | 3d78c4a6e5ae91eaf337b6f5cc6e8bb01af7c7b1 (diff) | |
download | cpython-02b84cb1b4f5407309c81c8b1ae0397355d6e568.zip cpython-02b84cb1b4f5407309c81c8b1ae0397355d6e568.tar.gz cpython-02b84cb1b4f5407309c81c8b1ae0397355d6e568.tar.bz2 |
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
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst b/Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst new file mode 100644 index 0000000..a435048 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst @@ -0,0 +1,4 @@ +Calling ``stop()`` on an unstarted or stopped :func:`unittest.mock.patch` +object will now return `None` instead of raising :exc:`RuntimeError`, +making the method idempotent. +Patch byKarthikeyan Singaravelan. |