mirror of
https://github.com/python/cpython.git
synced 2025-10-30 05:01:30 +00:00
[3.9] bpo-45097: Remove incorrect deprecation warnings in asyncio. (GH-28153)
Deprecation warnings about the loop argument were incorrectly emitted in cases when the loop argument was used inside the asyncio library, not from user code.
This commit is contained in:
parent
ce83e42437
commit
c967bd523c
11 changed files with 234 additions and 181 deletions
|
|
@ -301,11 +301,12 @@ async def producer(queue, num_items):
|
|||
with self.assertWarns(DeprecationWarning):
|
||||
q = asyncio.Queue(queue_size, loop=self.loop)
|
||||
|
||||
self.loop.run_until_complete(
|
||||
asyncio.gather(producer(q, producer_num_items),
|
||||
consumer(q, producer_num_items),
|
||||
loop=self.loop),
|
||||
)
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.loop.run_until_complete(
|
||||
asyncio.gather(producer(q, producer_num_items),
|
||||
consumer(q, producer_num_items),
|
||||
loop=self.loop),
|
||||
)
|
||||
|
||||
def test_cancelled_getters_not_being_held_in_self_getters(self):
|
||||
def a_generator():
|
||||
|
|
@ -555,8 +556,9 @@ async def getter():
|
|||
t1 = putter(1)
|
||||
t2 = putter(2)
|
||||
t3 = putter(3)
|
||||
self.loop.run_until_complete(
|
||||
asyncio.gather(getter(), t0, t1, t2, t3, loop=self.loop))
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.loop.run_until_complete(
|
||||
asyncio.gather(getter(), t0, t1, t2, t3, loop=self.loop))
|
||||
|
||||
def test_cancelled_puts_not_being_held_in_self_putters(self):
|
||||
def a_generator():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue