The Wayback Machine - https://web.archive.org/web/20221209050904/https://github.com/python/cpython/issues/100113
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove yield from usage from asyncio tests #100113

Open
kumaraditya303 opened this issue Dec 8, 2022 · 2 comments
Open

Remove yield from usage from asyncio tests #100113

kumaraditya303 opened this issue Dec 8, 2022 · 2 comments

Comments

@kumaraditya303
Copy link
Contributor

kumaraditya303 commented Dec 8, 2022

Support for yield from was deprecated and removed so it should be removed.

See

# The indirection fut->child_coro is needed since otherwise the
# gathering task is done at the same time as the child future
def child_coro():
return (yield from fut)
gather_future = asyncio.gather(child_coro())
return asyncio.ensure_future(gather_future)
gather_task = loop.run_until_complete(create())

Linked PRs

@vstinner
Copy link
Member

vstinner commented Dec 8, 2022

There are a few yield from in asyncio tests (Lib/test/test_asyncio/):

test_futures.py:296:            x = yield from f
test_futures.py:298:            y = yield from f
test_futures.py:303:        self.assertEqual(next(g), f)  # First yield from f.
test_futures.py:306:        # The second "yield from f" does not yield f.
test_futures.py:408:            yield from fut
test_pep492.py:152:            yield from ()
test_sslproto.py:99:        # yield from waiter hang if lost_connection was called.
test_tasks.py:2096:                return (yield from fut)
utils.py:271:            yield from _run_test_server(address=path, use_ssl=use_ssl,
utils.py:278:    yield from _run_test_server(address=(host, port), use_ssl=use_ssl,

@kumaraditya303
Copy link
Contributor Author

kumaraditya303 commented Dec 9, 2022

There are a few yield from in asyncio tests (Lib/test/test_asyncio/):

I think those are testing the internal implementation of futures and they are not used with asyncio APIs. I don't think they should be changed to await.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants