#NEWLINE# def assert_grammar_validation( grammar_errors , test_obj ) : #NEWLINE# #INDENT# 'Check grammar methods for validation errors' #NEWLINE# for ( attr , value , error , message ) in grammar_errors : #NEWLINE# #INDENT# with nt . assert_raises ( error ) as err : #NEWLINE# #INDENT# setattr ( test_obj , attr , value ) #NEWLINE# #UNINDENT# nt . assert_equal ( err . exception . args [ 0 ] , attr )