code: def _tests_factory(
      test_class, test_doc, list_analyzers, sources, skip_reasons={}
  ):
      """Define a test for each analyzer provided in the list"""
      for analyzer in list_analyzers:
          for source_type, source_file in sources.items():
  
              def test_func_factory(analyzer):
                  test_func = lambda self: self._perform_test(
                      analyzer, source_file
                  )
                  test_func.__doc__ = (
                      test_doc % analyzer.__name__ + "_" + source_type
                  )
                  return test_func
  
          test_func_name = "test_%s" % analyzer.__name__
          test_func = test_func_factory(analyzer)
  
          if analyzer.__name__ not in skip_reasons:
              setattr(test_class, test_func_name, test_func)
          else:  # Decorate with unittest.skip to skip test
              setattr(
                  test_class,
                  test_func_name,
                  unittest.skip(skip_reasons[analyzer.__name__])(
                      test_func
                  ),
              )
  
file_path: TimeSide/tests/test_analyzers_default.py
imports: import unittest
  from unit_timeside import TestRunner
  import numpy
  import timeside.core
  from timeside.plugins.decoder.aubio import AubioDecoder
  from timeside.core.tools.test_samples import samples
  from jsonschema import Draft4Validator
  import tempfile
label_desc: Use image node_id 1 for calling a global function with example usage: _tests_factory(test_class, test_doc, list_analyzers, sources, skip_reasons) and returns: test_func