I'm creating and running a bunch of async tasks in python 3.6. I'm getting ERROR Task was destroyed but it is pending!
errors when my app exits because I'm failing to clean something up. I'd like to debug that.
Asyncio nicely tells me which source line created the task that's still pending, but that doesn't help me because all my tasks are created at that same point. How can I tell which task is the delayed one? I can name the tasks distinctly (adding a name attribute and using it in repr()), but the error I get from asyncio doesn't call repr() on the task. Alternatively, how can I catch the "Task destroyed" exception, or stop in pdb there?