#NEWLINE# def test_patch_with_spec_mock_repr( self ) : #NEWLINE# #INDENT# for arg in ( 'spec' , 'autospec' , 'spec_set' ) : #NEWLINE# #INDENT# p = patch ( ( '%s.SomeClass' % __name__ ) , ** { #NEWLINE# #INDENT# arg : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# m = p . start ( ) #NEWLINE# try : #NEWLINE# #INDENT# self . assertIn ( " name='SomeClass'" , repr ( m ) ) #NEWLINE# self . assertIn ( " name='SomeClass.class_attribute'" , repr ( m . class_attribute ) ) #NEWLINE# self . assertIn ( " name='SomeClass()'" , repr ( m ( ) ) ) #NEWLINE# self . assertIn ( " name='SomeClass().class_attribute'" , repr ( m ( ) . class_attribute ) ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# p . stop ( )