-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
bpo-46309: Added reference to task created by StreamReaderProtocol #30505
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
Changes from 1 commit
62cdd31
11cc789
d1586c5
2a27d0c
2024570
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -801,6 +801,25 @@ def test_streamreaderprotocol_constructor_use_global_loop(self): | |
| self.assertEqual(cm.warnings[0].filename, __file__) | ||
| self.assertIs(protocol._loop, self.loop) | ||
|
|
||
| def test_streamreaderprotocol_task_reference(self): | ||
| # See http://bugs.python.org/issue46309 | ||
| messages = [] | ||
| self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx)) | ||
|
|
||
| async def callback(*args): | ||
| await self.loop.create_future() | ||
|
||
|
|
||
| async def test(): | ||
| reader = asyncio.StreamReader() | ||
| protocol = asyncio.StreamReaderProtocol(reader, callback) | ||
| transport = mock.Mock() | ||
| protocol.connection_made(transport) | ||
| await asyncio.sleep(0) | ||
| gc.collect() | ||
|
|
||
|
||
| self.loop.run_until_complete(test()) | ||
| self.assertEqual(messages, []) | ||
|
|
||
| def test_drain_raises(self): | ||
| # See http://bugs.python.org/issue25441 | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Added reference to task created in | ||
| :meth:`asyncio.streams.StreamReaderProtocol.connection_made`. |
Uh oh!
There was an error while loading. Please reload this page.