-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unittest.mock.MagicMock doesn't support __rdivmod__ #67756
Comments
Hey. I'm the upstream developer of padme https://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 |
I wrote a small patch and a test for it. Tested it on Python 3.5 and it worked. |
New changeset 35a780a9a3b4 by Berker Peksag in branch '3.4': New changeset 90f08e7fbdc3 by Berker Peksag in branch 'default': |
Thanks to both of you for the report and the patch. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: