[issue26467] Add async magic method support to unittest.mock.Mock

2016-06-05 Thread Yusuke Tsutsumi
Yusuke Tsutsumi added the comment: Taking a look at the code, this may require a bit more discussion. Mock's classes create copies of themselves when an attribute is accessed. As such, I can't just add __aexit__ and have it generate a different mock type entirely, unless I know exactly what

[issue26467] Add async magic method support to unittest.mock.Mock

2016-06-04 Thread Yusuke Tsutsumi
Yusuke Tsutsumi added the comment: I'm interested in taking this on. I'm considering for this approach, creating a new MagicProxy class specifically for async, and assigning __aexit__ and __aenter__ to those. The __call__ method itself has to be detected as asynchronous, and I don't believe

[issue18751] A manager's server never joins its threads

2016-06-04 Thread Yusuke Tsutsumi
Yusuke Tsutsumi added the comment: I'm interested in taking this on. I can do the following: * keep track of the threads in a field attached to the class * handle thread synchronization and cleanup in the finally block * set a flag on the exception, which ensures the loop completes, vs