classification
Title: unittest.mock: Add __round__ to supported magicmock methods
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jreese, lukasz.langa, michael.foord, mjpieters, vstinner
Priority: normal Keywords: patch

Created on 2018-05-15 11:48 by mjpieters, last changed 2018-05-22 20:02 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6880 merged jreese, 2018-05-15 21:36
Messages (3)
msg316641 - (view) Author: Martijn Pieters (mjpieters) * Date: 2018-05-15 11:48
I notice that __trunc__, __floor__ and __ceil__ are supported methods for MagicMock, but __round__ (in the same grouping of numeric types emulation methods, see https://docs.python.org/3/reference/datamodel.html#object.__round__), is not.

Please add this to the mapping too.
msg317336 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-22 20:01
New changeset 6c4fab0f4b95410a1a964a75dcdd953697eff089 by Victor Stinner (John Reese) in branch 'master':
bpo-33516: Add support for __round__ in MagicMock (GH-6880)
https://github.com/python/cpython/commit/6c4fab0f4b95410a1a964a75dcdd953697eff089
msg317337 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-05-22 20:02
Thank you Martijn Pieters for the feature request/bug report, and thanks John Reese for the implementation!
History
Date User Action Args
2018-05-22 20:02:10vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg317337

stage: patch review -> resolved
2018-05-22 20:01:15vstinnersetnosy: + vstinner
messages: + msg317336
2018-05-18 18:05:17terry.reedysetnosy: + michael.foord

versions: + Python 3.8
2018-05-17 15:08:37jreesesetnosy: + lukasz.langa, jreese
2018-05-15 21:36:52jreesesetkeywords: + patch
stage: patch review
pull_requests: + pull_request6553
2018-05-15 11:48:12mjpieterscreate