docstr: Adds a test to suite
  
  Parameters
  ----------
  test : AbstractTest
      test
  name : string
      test name. If test has test.name, this is optional.
  capability : string
      test capability. If test has test.capability, this is optional.
  description : string
      test description. If test has test.capability, this is optional.
  format_example_fn : function
      If not None, use this to print a failed example within a test case
      Arguments: (x, pred, conf, label=None, meta=None)
  print_fn : function
      If not None, use this to print a failed test case.
      Arguments: (xs, preds, confs, expect_results, labels=None, meta=None)
  overwrite : bool
      If False, will raise exception if test with same name is already in suite.
docstr_tok: ["Adds","a","test","to","suite","Parameters","--","--","--","--","--","test",":","AbstractTest","test","name",":","string","test","name",".","If","test","has","test.name",",","this","is","optional",".","capability",":","string","test","capability",".","If","test","has","test.capability",",","this","is","optional",".","description",":","string","test","description",".","If","test","has","test.capability",",","this","is","optional",".","format_example_fn",":","function","If","not","None",",","use","this","to","print","a","failed","example","within","a","test","case","Arguments",":","(","x",",","pred",",","conf",",","label=None",",","meta=None",")","print_fn",":","function","If","not","None",",","use","this","to","print","a","failed","test","case",".","Arguments",":","(","xs",",","preds",",","confs",",","expect_results",",","labels=None",",","meta=None",")","overwrite",":","bool","If","False",",","will","raise","exception","if","test","with","same","name","is","already","in","suite","."]
code: def add(
      self,
      test,
      name=None,
      capability=None,
      description=None,
      format_example_fn=None,
      print_fn=None,
      overwrite=False,
  ):
      """Adds a test to suite
  
      Parameters
      ----------
      test : AbstractTest
          test
      name : string
          test name. If test has test.name, this is optional.
      capability : string
          test capability. If test has test.capability, this is optional.
      description : string
          test description. If test has test.capability, this is optional.
      format_example_fn : function
          If not None, use this to print a failed example within a test case
          Arguments: (x, pred, conf, label=None, meta=None)
      print_fn : function
          If not None, use this to print a failed test case.
          Arguments: (xs, preds, confs, expect_results, labels=None, meta=None)
      overwrite : bool
          If False, will raise exception if test with same name is already in suite.
  
      """
      if name is None and test.name is None:
          raise (
              Exception(
                  "If test does not have test.name, you must specify a name"
              )
          )
      if capability is None and test.capability is None:
          raise (
              Exception(
                  "If test does not have test.capabiliy, you must specify a capability"
              )
          )
      if name is None:
          name = test.name
      if capability is None:
          capability = test.capability
      if description is None:
          description = test.description
      if name in self.tests and not overwrite:
          raise (
              Exception(
                  "There is already a test named %s suite. Run with overwrite=True to overwrite"
                  % name
              )
          )
      if name in self.info:
          del self.info[name]
      type_map = {
          MFT: "MFT",
          INV: "INV",
          DIR: "DIR",
      }
      typez = type_map[type(test)]
      self.tests[name] = test
      self.info[name]["capability"] = capability
      self.info[name]["type"] = typez
      if description:
          self.info[name]["description"] = description
      if format_example_fn:
          self.info[name]["format_example_fn"] = format_example_fn
      if print_fn:
          self.info[name]["print_fn"] = format_example_fn
  
imports: import collections
  from collections import defaultdict, OrderedDict
  import dill
  import json
  from .abstract_test import load_test, read_pred_file
  from .test_types import MFT, INV, DIR
  from .viewer.suite_summarizer import SuiteSummarizer
label_desc: Use image node_id 3 for calling the TestSuite obj's underlying member method code with example usage: obj.add(test, name, capability, description, format_example_fn, print_fn, overwrite) without return types