def cleanup_test_name(name, strip_tags=True, strip_scenarios=False):
 if strip_tags:
  tags_start = name.find('[')
  tags_end = name.find(']')
  if ((tags_start > 0) and (tags_end > tags_start)):
   newname = name[:tags_start]
   newname += name[(tags_end + 1):]
   name = newname
 if strip_scenarios:
  tags_start = name.find('(')
  tags_end = name.find(')')
  if ((tags_start > 0) and (tags_end > tags_start)):
   newname = name[:tags_start]
   newname += name[(tags_end + 1):]
   name = newname
 return name

def cleanup_test_name ( name , strip_tags = True , strip_scenarios = False ) : if strip_tags : tags_start = name . find ( '[' ) tags_end = name . find ( ']' ) if ( ( tags_start > 0 ) and ( tags_end > tags_start ) ) : newname = name [ : tags_start ] newname += name [ ( tags_end + 1 ) : ] name = newname if strip_scenarios : tags_start = name . find ( '(' ) tags_end = name . find ( ')' ) if ( ( tags_start > 0 ) and ( tags_end > tags_start ) ) : newname = name [ : tags_start ] newname += name [ ( tags_end + 1 ) : ] name = newname return name
clean up the test name for display .