parameters: (self, mock, attribute)
docstring: Attach a mock as an attribute of this one, replacing its name and
          parent. Calls to the attached mock will be recorded in the
          `method_calls` and `mock_calls` attributes of this one.
docstring_summary: Attach a mock as an attribute of this one, replacing its name and
          parent. Calls to the attached mock will be recorded in the
          `method_calls` and `mock_calls` attributes of this one.
docstring_tokens: Attach a mock as an attribute of this one replacing its name and parent . Calls to the attached mock will be recorded in the method_calls and mock_calls attributes of this one .
function: def attach_mock(self, mock, attribute):
          """
          Attach a mock as an attribute of this one, replacing its name and
          parent. Calls to the attached mock will be recorded in the
          `method_calls` and `mock_calls` attributes of this one."""
          mock._mock_parent = None
          mock._mock_new_parent = None
          mock._mock_name = ''
          mock._mock_new_name = None
  
          setattr(self, attribute, mock)
function_tokens: def attach_mock ( self , mock , attribute ) : mock . _mock_parent = None mock . _mock_new_parent = None mock . _mock_name = '' mock . _mock_new_name = None setattr ( self , attribute , mock )