#NEWLINE# def cleanup_test_name( name , strip_tags = True , strip_scenarios = False ) : #NEWLINE# #INDENT# "Clean up the test name for display.\n\n    By default we strip out the tags in the test because they don't help us\n    in identifying the test that is run to it's result.\n\n    Make it possible to strip out the testscenarios information (not to\n    be confused with tempest scenarios) however that's often needed to\n    indentify generated negative tests.\n    " #NEWLINE# if strip_tags : #NEWLINE# #INDENT# tags_start = name . find ( '[' ) #NEWLINE# tags_end = name . find ( ']' ) #NEWLINE# if ( ( tags_start > 0 ) and ( tags_end > tags_start ) ) : #NEWLINE# #INDENT# newname = name [ : tags_start ] #NEWLINE# newname += name [ ( tags_end + 1 ) : ] #NEWLINE# name = newname #NEWLINE# #UNINDENT# #UNINDENT# if strip_scenarios : #NEWLINE# #INDENT# tags_start = name . find ( '(' ) #NEWLINE# tags_end = name . find ( ')' ) #NEWLINE# if ( ( newname > 0 ) and ( tags_end > tags_start ) ) : #NEWLINE# #INDENT# newname = name [ : tags_start ] #NEWLINE# newname += name [ ( tags_end + 1 ) : ] #NEWLINE# name = newname #NEWLINE# #UNINDENT# #UNINDENT# return name