Python 3.10 test failure: ERROR: test_future_cancel: TypeError: sleep() got an unexpected keyword argument 'loop'
mgorny opened this issue · comments
When running tests with Python 3.10.0b1:
======================================================================
ERROR: test_future_cancel (__main__.DNSTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/aiodns/tests.py", line 122, in test_future_cancel
self.loop.run_until_complete(coro())
File "/usr/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/tmp/aiodns/tests.py", line 119, in coro
await asyncio.sleep(0.1, loop=self.loop)
TypeError: sleep() got an unexpected keyword argument 'loop'
Apparently the loop
parameter was deprecated since Python 3.8.
Yeah I think we can remove the explicit loop since it will be picked from the thread local storage.
Mind sending a PR?
Sure, will do in a minute.
Awesome, thanks!