#NEWLINE# def test_autospec_with_new( self ) : #NEWLINE# #INDENT# patcher = patch ( ( '%s.function' % __name__ ) , new = 3 , autospec = True ) #NEWLINE# self . assertRaises ( TypeError , patcher . start ) #NEWLINE# module = sys . modules [ __name__ ] #NEWLINE# patcher = patch . object ( module , 'function' , new = 3 , autospec = True ) #NEWLINE# self . assertRaises ( TypeError , patcher . start )