code: def test_pause_reading(self):
      limit = 10
      size = limit * 2 + 1
  
      async def test_pause_reading():
          code = "\n".join(
              (
                  "import sys",
                  'sys.stdout.write("x" * %s)' % size,
                  "sys.stdout.flush()",
              )
          )
  
          connect_read_pipe = self.loop.connect_read_pipe
  
          async def connect_read_pipe_mock(*args, **kw):
              transport, protocol = await connect_read_pipe(*args, **kw)
              transport.pause_reading = mock.Mock()
              transport.resume_reading = mock.Mock()
              return (transport, protocol)
  
          self.loop.connect_read_pipe = connect_read_pipe_mock
  
          proc = await asyncio.create_subprocess_exec(
              sys.executable,
              "-c",
              code,
              stdin=asyncio.subprocess.PIPE,
              stdout=asyncio.subprocess.PIPE,
              limit=limit,
          )
          stdout_transport = proc._transport.get_pipe_transport(1)
  
          stdout, stderr = await proc.communicate()
  
          # The child process produced more than limit bytes of output,
          # the stream reader transport should pause the protocol to not
          # allocate too much memory.
          return (stdout, stdout_transport)
  
      # Issue #22685: Ensure that the stream reader pauses the protocol
      # when the child process produces too much data
      stdout, transport = self.loop.run_until_complete(
          test_pause_reading()
      )
  
      self.assertEqual(stdout, b"x" * size)
      self.assertTrue(transport.pause_reading.called)
      self.assertTrue(transport.resume_reading.called)
  
imports: import os
  import signal
  import sys
  import textwrap
  import unittest
  import warnings
  from unittest import mock
  import asyncio
  from asyncio import base_subprocess
  from asyncio import subprocess
  from test.test_asyncio import utils
  from test import support
  from test.support import os_helper
label_desc: Use image node_id 12 for calling the SubprocessMixin obj's underlying member method code with example usage: obj.test_pause_reading() and returns: stdout,  stdout_transport, transport,  protocol