CraftSpider / dpytest

A package that assists in writing tests for discord.py
MIT License
103 stars 24 forks source link

Support asyncio tasks that have no __name__ #108

Closed clarkperkins closed 1 year ago

clarkperkins commented 1 year ago

Resolves these sorts of errors:

x = <Task finished name='Task-17' coro=<<async_generator_athrow without __name__>()> result=None>

>   if not any(map(lambda x: x._coro.__name__ == "_run_event" and not (x.done() or x.cancelled()), pending)):
E   AttributeError: 'async_generator_athrow' object has no attribute '__name__'

../../../.virtualenvs/saucerbot/lib/python3.11/site-packages/discord/ext/test/runner.py:73: AttributeError