Janne Karila added the comment:
The length assertion protects the test from breaking with IndexError. How about
this? Though, it looks like two test cases to me.
+self.pool.map_async(int, ['1'],
+callback=call_a
Janne Karila added the comment:
Otherwise I agree, but what if one of the callbacks is not called? The test
case would fail on assertEqual(2, len(call_args)) but you wouldn't know which
callback is the problem.
--
___
Python tracker
Janne Karila added the comment:
Three test cases added.
The tricky part in writing the tests was to realize that when the tests are run
with Manager, the callback goes through a proxy object.
--
Added file: http://bugs.python.org/file27711/test_callback.patch
Janne Karila added the comment:
I'm working on the test. It keeps failing...
--
___
Python tracker
<http://bugs.python.org/issue16307>
___
___
Python-bugs-l
Janne Karila added the comment:
Here's a patch that adds the missing arguments to the call to _map_async.
The bug seems to originate from enhancement #12708 that added starmap_async to
3.3.
--
keywords: +patch
Added file: http://bugs.python.org/file27690/callback.
Janne Karila added the comment:
Indeed, the current implementation map_async simply ignores the callback
arguments:
def map_async(self, func, iterable, chunksize=None, callback=None,
error_callback=None):
'''
Asynchronous version of `map()` method.