[issue21345] multiprocessing.Pool._handle_workers sleeps too long

2014-04-24 Thread Johannes Baiter
New submission from Johannes Baiter: While testing a module that uses multiprocessing.Pool to distribute load across multiple processes, I noticed that my test suite was copmleting very quickly (~0.15s) on Python 2.6, while Python 2.7 and above took around 10x as long (~1.6s). Upon debugging

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-31 Thread Johannes Baiter
Johannes Baiter added the comment: Sorry for commenting so late, I submitted a version of the patch with unit tests roughly two weeks ago, I just forgot to mention it in a comment. Hereby fixed :-) -- ___ Python tracker <http://bugs.python.

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-19 Thread Johannes Baiter
Changes by Johannes Baiter : Added file: http://bugs.python.org/file34515/mock_truediv_with_tests.diff ___ Python tracker <http://bugs.python.org/issue20968> ___ ___ Pytho

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-19 Thread Johannes Baiter
Johannes Baiter added the comment: >From looking at 'test_numerics', only 'add' is currently tested. Probably since the mechanism for all of the numeric magic methods is the same (i.e. create , __i__, __r__). Should I add a test for __truediv__ and its inp

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-18 Thread Johannes Baiter
Johannes Baiter added the comment: 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 correctl

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-18 Thread Johannes Baiter
Johannes Baiter added the comment: Attached is a patch that fixes the issue for me. -- keywords: +patch Added file: http://bugs.python.org/file34490/mock_truediv.diff ___ Python tracker <http://bugs.python.org/issue20

[issue20968] mock.MagicMock does not mock __truediv__

2014-03-18 Thread Johannes Baiter
New submission from Johannes Baiter: It seems that when creating a MagicMock the magic '__truediv__' method is not replaced with a mock: >>> import mock >>> foo = mock.MagicMock() >>> foo / 2 Traceback (most recent call last): File "", line 1,