Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue23568

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:unittest.mock.MagicMock doesn't support __rdivmod__
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.4, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Håkan Lövdahl, berker.peksag, michael.foord, python-dev, rbcollins, zkrynicki
Priority:normalKeywords:patch

Created on2015-03-03 08:36 byzkrynicki, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
issue23568.patchHåkan Lövdahl,2015-03-07 12:04patch and testreview
Messages (4)
msg237112 -(view)Author: Zygmunt Krynicki (zkrynicki)Date: 2015-03-03 08:36
Hey.I'm the upstream developer of padmehttps://github.com/zyga/padme -- the mostly transparent proxy class for Python. While working on unit tests for proxying numeric methods I realized that there are a few bugs in the mock library.The bug I'd like to report now is that __rdivmod__ cannot be mocked by MagicMock. This seems to be caused by the fact that it is listed as magic but not as numeric (for which right-hand-side variants are created).Note that it cannot be simply added to numeric as it doesn't have the augmented assignment variant (there is no __idivmod__).The bug is present in all versions of Python that come with unittest.mock (3.3, 3.4 and 3.5) and it is also present in the upstream/standalone version of mock
msg237441 -(view)Author: Håkan Lövdahl (Håkan Lövdahl)Date: 2015-03-07 12:04
I wrote a small patch and a test for it. Tested it on Python 3.5 and it worked.
msg238111 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2015-03-14 23:57
New changeset35a780a9a3b4 by Berker Peksag in branch '3.4':Issue#23568: Add rdivmod support to MagicMock() objects.https://hg.python.org/cpython/rev/35a780a9a3b4New changeset90f08e7fbdc3 by Berker Peksag in branch 'default':Issue#23568: Add rdivmod support to MagicMock() objects.https://hg.python.org/cpython/rev/90f08e7fbdc3
msg238112 -(view)Author: Berker Peksag (berker.peksag)*(Python committer)Date: 2015-03-15 00:02
Thanks to both of you for the report and the patch.
History
DateUserActionArgs
2022-04-11 14:58:13adminsetgithub: 67756
2015-03-15 00:02:16berker.peksagsetstatus: open -> closed
versions: + Python 3.4, Python 3.5, - Python 3.3
messages: +msg238112

resolution: fixed
stage: resolved
2015-03-14 23:57:44python-devsetnosy: +python-dev
messages: +msg238111
2015-03-07 12:04:08Håkan Lövdahlsetfiles: +issue23568.patch

nosy: +Håkan Lövdahl
messages: +msg237441

keywords: +patch
2015-03-04 02:57:01berker.peksagsetnosy: +berker.peksag
2015-03-03 22:42:18ned.deilysetnosy: +rbcollins,michael.foord
2015-03-03 08:42:49zkrynickisettype: behavior
versions: + Python 3.3, - Python 3.4, Python 3.5
2015-03-03 08:36:32zkrynickisettitle: unittest.mock.MagicMock doesn't support __rdivmod__t -> unittest.mock.MagicMock doesn't support __rdivmod__
2015-03-03 08:36:25zkrynickicreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp