The @asyncio.coroutine decorator has been deprecated since Python 3.8, and is removed entirely in 3.11. This causes the tests to fail immediately:
$ python3.11 run_tests.py
Traceback (most recent call last):
File "/tmp/yappi/run_tests.py", line 29, in <module>
test_suite = test_loader.loadTestsFromNames(tests)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/loader.py", line 220, in loadTestsFromNames
suites = [self.loadTestsFromName(name, module) for name in names]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/loader.py", line 220, in <listcomp>
suites = [self.loadTestsFromName(name, module) for name in names]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/unittest/loader.py", line 154, in loadTestsFromName
module = __import__(module_name)
^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/yappi/tests/test_asyncio.py", line 8, in <module>
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'. Did you mean: 'coroutines'?
IIUC the replacement is async def, with await instead of yield from.
The
@asyncio.coroutine
decorator has been deprecated since Python 3.8, and is removed entirely in 3.11. This causes the tests to fail immediately:IIUC the replacement is
async def
, withawait
instead ofyield from
.