#NEWLINE# def test_format_error_causes_become_validation_error_causes( self ) : #NEWLINE# #INDENT# checker = FormatChecker ( ) #NEWLINE# checker . checks ( 'foo' , raises = ValueError ) ( self . fn ) #NEWLINE# cause = self . fn . side_effect = ValueError ( ) #NEWLINE# validator = Draft4Validator ( { #NEWLINE# #INDENT# 'format' : 'foo' , #NEWLINE# #UNINDENT# } , format_checker = checker ) #NEWLINE# with self . assertRaises ( ValidationError ) as cm : #NEWLINE# #INDENT# validator . validate ( 'bar' ) #NEWLINE# #UNINDENT# self . assertIs ( self . exception . __cause__ , cause )