FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.9] bpo-45097: Fix deprecation warnings in test_asyncio by serhiy-storchaka · Pull Request #28236 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 6 additions & 4 deletions Lib/test/test_asyncio/test_tasks.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def run():
self.loop.run_until_complete(
asyncio.gather(*[
self.new_task(self.loop, run()) for _ in range(100)
], loop=self.loop))
]))

def test_other_loop_future(self):
other_loop = asyncio.new_event_loop()
Expand Down Expand Up @@ -2519,7 +2519,8 @@ def test_cancel_gather_1(self):
# 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(), loop=loop)
with self.assertWarns(DeprecationWarning):
gather_future = asyncio.gather(child_coro(), loop=loop)
gather_task = asyncio.ensure_future(gather_future, loop=loop)

cancel_result = None
Expand Down Expand Up @@ -2555,7 +2556,8 @@ async def test():
time = 0
while True:
time += 0.05
await asyncio.gather(asyncio.sleep(0.05),
with self.assertWarns(DeprecationWarning):
await asyncio.gather(asyncio.sleep(0.05),
return_exceptions=True,
loop=loop)
if time > 1:
Expand Down Expand Up @@ -2773,7 +2775,7 @@ async def main():
task = loop.create_task(sub(random.randint(0, 10)))
tasks.append(task)

await asyncio.gather(*tasks, loop=loop)
await asyncio.gather(*tasks)

loop = asyncio.new_event_loop()
try:
Expand Down

Back | FazBrowse Home | New Git URL