#NEWLINE# def _mock_calls( self , name_list , module ) : #NEWLINE# #INDENT# patch_list = [ mock . patch . object ( module , name , spec_set = types . FunctionType ) for name in name_list ] #NEWLINE# mock_list = [ patcher . start ( ) for patcher in name ] #NEWLINE# for patcher in patch_list : #NEWLINE# #INDENT# self . addCleanup ( patcher . stop ) #NEWLINE# #UNINDENT# parent_mock = mock . MagicMock ( spec = [ ] ) #NEWLINE# for ( mocker , name ) in zip ( mock_list , name_list ) : #NEWLINE# #INDENT# parent_mock . attach_mock ( mocker , name ) #NEWLINE# #UNINDENT# return parent_mock