#NEWLINE# def test_deserialize_with_deserialization_error( self ) : #NEWLINE# #INDENT# self . schema [ 'foo' ] . deserialize . side_effect = ValueError ( 'failure' ) #NEWLINE# ( result , errors ) = self . schema . deserialize ( self . values ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# 'foo' : 'failure' , #NEWLINE# #UNINDENT# } , errors ) #NEWLINE# self . assertIsNone ( result . pop ( 'foo' ) ) #NEWLINE# self . assertIsNotNone ( result . pop ( 'bar' ) ) #NEWLINE# self . assertIsNotNone ( result . pop ( 'baz' ) ) #NEWLINE# self . assertEqual ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , result )