code: def run_tests_in_object(ob):
      # Setup
      for name in dir(ob):
          if name.lower().startswith("setup"):
              print("Calling %s" % name)
              getattr(ob, name)()
      # Exec
      for name in sorted(
          dir(ob), key=lambda x: x.lower()
      ):  # consistent order
          val = getattr(ob, name)
          if name.startswith("_"):
              continue
          elif callable(val) and (
              name[:4] == "test" or name[-4:] == "test"
          ):
              print("Running test-func %s ... " % name, end="")
              try:
                  val()
                  print("ok")
              except Exception as err:
                  if "skiptest" in err.__class__.__name__.lower():
                      print("skip")
                  else:
                      raise
          elif isinstance(val, type) and "Test" in name:
              print("== Running test-class %s" % name)
              run_tests_in_object(val())
              print("== Done with test-class %s" % name)
      # Teardown
      for name in dir(ob):
          if name.lower().startswith("teardown"):
              print("Calling %s" % name)
              getattr(ob, name)()
  
imports: from __future__ import print_function
  import numpy
  import sys
  import os
  import inspect
  import gc
  import pytest
  import functools
  from packaging.version import Version
  from ..util.check_environment import has_backend
label_desc: Use image node_id 30 for calling a global function with example usage: run_tests_in_object(ob) without return types