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
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
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