8000 bpo-46771: Implement asyncio context managers for handling timeouts by asvetlov · Pull Request #31394 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46771: Implement asyncio context managers for handling timeouts #31394

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

Merged
merged 31 commits into from
Mar 10, 2022
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dac5874
bpo-46771: Implement asyncio context managers for handling timeouts
asvetlov Mar 2, 2022
374ff2a
Add reschedule tests
asvetlov Mar 2, 2022
70fa59b
Add reschedule tests
asvetlov Mar 2, 2022
3ae2af6
Dro breakpoint
asvetlov Mar 2, 2022
1654ec4
Tune repr
asvetlov Mar 2, 2022
2c9dbf8
Add tests
asvetlov Mar 2, 2022
baa7400
More tests
asvetlov Mar 2, 2022
1ca0fb8
Rename
asvetlov Mar 2, 2022
8a81dd1
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
fae235d
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
663b82f
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
24d62d1
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
6a26d1b
Add a test
asvetlov Mar 8, 2022
930b92b
Polish docstrings
asvetlov Mar 8, 2022
ac5c53d
Format
asvetlov Mar 8, 2022
f96ad1c
Tune tests
asvetlov Mar 8, 2022
94b4b4c
Fix comment
asvetlov Mar 8, 2022
388c6da
Tune comment
asvetlov Mar 8, 2022
cdc7f88
Tune docstrings
asvetlov Mar 8, 2022
9949fe4
Tune
asvetlov Mar 8, 2022
c716856
Tune tests
asvetlov Mar 8, 2022
b4889a0
Update Lib/test/test_asyncio/test_timeouts.py
asvetlov Mar 8, 2022
b6504e6
Tune tests
asvetlov Mar 8, 2022
fd2688d
8000 Don't clobber foreign exceptions even if timeout is expiring
gvanrossum Mar 9, 2022
2ddda69
Add test from discussion
gvanrossum Mar 9, 2022
493545a
Fix indent of added test
gvanrossum Mar 9, 2022
ff36f2a
Disable slow callback warning
asvetlov Mar 9, 2022
8790e49
Reformat
asvetlov Mar 9, 2022
ac6f8c8
Increase delay
asvetlov Mar 9, 2022
e8c67ce
Don't raise TimeoutError if the CancelledError was swallowed by inner…
asvetlov Mar 9, 2022
e65d766
Don't duplicate py/c tests, timeout has no C accelerators
asvetlov Mar 10, 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
Tune comment
  • Loading branch information
asvetlov committed Mar 9, 2022
commit 388c6da3147fbee31ad1eb1a2855632d604b4ad3
9 changes: 3 additions & 6 deletions Lib/test/test_asyncio/test_timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ async def test_timeout_not_called(self):
t1 = loop.time()

self.assertFalse(cm.expired())
# finised fast. Very busy CI box requires high enough limit,
# that's why 0.01 cannot be used
# 2 sec for slow CI boxes
self.assertLess(t1-t0, 2)
self.assertGreater(cm.when(), t1)

Expand All @@ -91,8 +90,7 @@ async def test_timeout_disabled(self):

self.assertFalse(cm.expired())
self.assertIsNone(cm.when())
# finised fast. Very busy CI box requires high enough limit,
# that's why 0.01 cannot be used
# 2 sec for slow CI boxes
self.assertLess(t1-t0, 2)

async def test_timeout_at_disabled(self):
Expand All @@ -116,8 +114,7 @@ async def test_timeout_zero(self):
await asyncio.sleep(10)
t1 = loop.time()
self.assertTrue(cm.expired())
# finised fast. Very busy CI box requires high enough limit,
# that's why 0.01 cannot be used
# 2 sec for slow CI boxes
self.assertLess(t1-t0, 2)
self.assertTrue(t0 <= cm.when() <= t1)

Expand Down
0