8000 gh-95601: restore support for awaitable objects that are not futures in `asyncio.wait` by graingert · Pull Request #95708 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-95601: restore support for awaitable objects that are not futures in asyncio.wait #95708

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

Closed
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
88580c9
gh-95601: forbid non-futures in asyncio.wait
graingert Aug 5, 2022
1363c9b
📜🤖 Added by blurb_it.
blurb-it[bot] Aug 5, 2022
543c4f2
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Aug 5, 2022
6661052
clarify awaitable-not-future
graingert Aug 5, 2022
5b740df
update asyncio.wait deprecation notice
graingert Aug 5, 2022
5b974c5
Update Doc/library/asyncio-task.rst
graingert Aug 5, 2022
c4a7237
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Aug 5, 2022
d4dac27
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Aug 9, 2022
cb00279
Apply suggestions from code review
graingert Aug 9, 2022
38fb812
Update Misc/NEWS.d/next/Library/2022-08-05-11-16-33.gh-issue-95601.hJ…
graingert Aug 9, 2022
5383116
Update Lib/test/test_asyncio/test_tasks.py
graingert Aug 9, 2022
b6ea455
upgrade WaitTests to an IsolatedAsyncioTestCase
graingert Aug 9, 2022
980a3b9
Update Lib/test/test_asyncio/test_tasks.py
graingert Aug 9, 2022
d8354db
Update Lib/test/test_asyncio/test_tasks.py
graingert Aug 9, 2022
5f1d061
Update Lib/test/test_asyncio/test_tasks.py
graingert Aug 9, 2022
9181e25
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Aug 11, 2022
f973c52
test that asyncio.wait gives the right type error for non-awaitable n…
graingert Aug 12, 2022
0430145
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Aug 12, 2022
9189603
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Sep 12, 2022
9c325b4
don't deprecate Awaitables in wait yet
graingert Sep 12, 2022
da9f2a2
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Sep 12, 2022
7e35d9c
remove deprecation docs
graingert Sep 12, 2022
a5c5f4a
remove deprecation assertions from tests for asyncio.wait
graingert Sep 13, 2022
17cbfc9
Update Misc/NEWS.d/next/Library/2022-08-05-11-16-33.gh-issue-95601.hJ…
graingert Sep 13, 2022
69b2a0d
Merge branch 'main' into forbid-non-futures-in-asyncio-wait
graingert Sep 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove deprecation assertions from tests for asyncio.wait
  • Loading branch information
graingert committed Sep 13, 2022
commit a5c5f4a9ae899f3c12c607a48aebfcaae3e9670b
22 changes: 9 additions & 13 deletions Lib/test/test_asyncio/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3241,28 +3241,24 @@ async def coro():


class WaitTests(unittest.IsolatedAsyncioTestCase):
async def test_awaitable_is_deprecated_in_wait(self):
# Remove test when passing awaitables to asyncio.wait() is removed in 3.14
async def test_wait_supports_awaitables(self):

class ExampleAwaitable:
def __await__(self):
return asyncio.sleep(0).__await__()

with self.assertWarnsRegex(
DeprecationWarning,
"awaitable objects that are not futures",
):
await asyncio.wait([ExampleAwaitable()])
await asyncio.wait([ExampleAwaitable()])

task = asyncio.create_task(coroutine_function())
with (
self.assertWarnsRegex(
DeprecationWarning, "awaitable objects that are not futures"
),
self.assertRaises(TypeError),
coro = coroutine_function()
with self.assertRaisesRegex(
TypeError,
r"Passing coroutines is forbidden, use tasks explicitly."
):
await asyncio.wait([task, ExampleAwaitable(), coroutine_function()])
await asyncio.wait([task, ExampleAwaitable(), coro])

# avoid: coroutine 'coroutine_function' was never awaited
coro.close()
# avoid: Task was destroyed but it is pending!
await task

Expand Down
0