mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #22685: Fix test_pause_reading() of asyncio test_subprocess
* mock also resume_reading() * ensure that resume_reading() is called
This commit is contained in:
parent
fe22e0985a
commit
dd8224e6a4
1 changed files with 2 additions and 0 deletions
|
@ -181,6 +181,7 @@ class SubprocessMixin:
|
||||||
loop=self.loop)
|
loop=self.loop)
|
||||||
stdout_transport = proc._transport.get_pipe_transport(1)
|
stdout_transport = proc._transport.get_pipe_transport(1)
|
||||||
stdout_transport.pause_reading = mock.Mock()
|
stdout_transport.pause_reading = mock.Mock()
|
||||||
|
stdout_transport.resume_reading = mock.Mock()
|
||||||
|
|
||||||
stdout, stderr = yield from proc.communicate()
|
stdout, stderr = yield from proc.communicate()
|
||||||
|
|
||||||
|
@ -195,6 +196,7 @@ class SubprocessMixin:
|
||||||
|
|
||||||
self.assertEqual(stdout, b'x' * size)
|
self.assertEqual(stdout, b'x' * size)
|
||||||
self.assertTrue(transport.pause_reading.called)
|
self.assertTrue(transport.pause_reading.called)
|
||||||
|
self.assertTrue(transport.resume_reading.called)
|
||||||
|
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue