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
assignee='https://github.com/voidspace'closed_at=<Date2014-04-14.15:44:42.196>created_at=<Date2014-03-18.14:13:34.429>labels= ['type-bug', 'library']
title='mock.MagicMock does not mock __truediv__'updated_at=<Date2014-04-14.15:44:42.195>user='https://bugs.python.org/JohannesBaiter'
I just noticed that I put the magic method names in the wrong place in the patch.
Attached is a fix that adds 'truediv' to the global 'numberics' variable, this way '__rtruediv__' and '__itruediv__' will be correctly mocked as well.
Well, as this is a regression fix we definitley need a test. Ideally we would test all the operations - I didn't realise that only add was tested! However for this specific issue, just testing division is fine, and yes testing in place and right hand as well would be good.