erdewit / nest_asyncio

Patch asyncio to allow nested event loops
BSD 2-Clause "Simplified" License
693 stars 79 forks source link

Python 3.10: test_two_run_until_completes_in_one_outer_loop test fails #56

Closed mgorny closed 3 years ago

mgorny commented 3 years ago
======================================================================                
ERROR: test_two_run_until_completes_in_one_outer_loop (tests.nest_test.NestTest)
----------------------------------------------------------------------                
Traceback (most recent call last):                                                                                                                                           
  File "/tmp/portage/dev-python/nest_asyncio-1.5.1/work/nest_asyncio-1.5.1/tests/nest_test.py", line 87, in test_two_run_until_completes_in_one_outer_loop                   
    asyncio.gather(f1(), f2(), loop=self.loop))                                       
TypeError: gather() got an unexpected keyword argument 'loop'       

The loop parameter has been removed in py3.10.

erdewit commented 3 years ago

Thanks for the report, the loop parameter has been removed from the test suite.

Python 3.10 doesn't seem to be available for Github workflows yet, so it's not tested in CI right now.

mgorny commented 3 years ago

It is available but you have to specify that you allow pre-released versions explicitly, e.g.:

python-version: '3.10.0-alpha - 3.10.0'

See e.g. https://github.com/pkgcore/pkgcheck/blob/master/.github/workflows/test.yml#L19

erdewit commented 3 years ago

Yep that works - thanks for the tip.