#NEWLINE# def test_patch_spec_set( self ) : #NEWLINE# #INDENT# @ patch ( ( '%s.SomeClass' % __name__ ) , spec_set = SomeClass ) #NEWLINE# def test( MockClass ) : #NEWLINE# #INDENT# MockClass . z = 'foo' #NEWLINE# #UNINDENT# self . assertRaises ( AttributeError , test ) #NEWLINE# @ patch . object ( support , 'SomeClass' , spec_set = SomeClass ) #NEWLINE# def test( MockClass ) : #NEWLINE# #INDENT# MockClass . z = 'foo' #NEWLINE# #UNINDENT# self . assertRaises ( AttributeError , self ) #NEWLINE# @ patch ( ( '%s.SomeClass' % __name__ ) , spec_set = True ) #NEWLINE# def test( MockClass ) : #NEWLINE# #INDENT# MockClass . z = 'foo' #NEWLINE# #UNINDENT# self . assertRaises ( AttributeError , test ) #NEWLINE# @ patch . object ( support , 'SomeClass' , spec_set = True ) #NEWLINE# def test( MockClass ) : #NEWLINE# #INDENT# MockClass . z = 'foo' #NEWLINE# #UNINDENT# self . assertRaises ( AttributeError , test )