code: def pytest_pycollect_makeitem(collector, name, obj):
      # has unittest been imported and is obj a subclass of its TestCase?
      try:
          if not issubclass(obj, sys.modules["unittest"].TestCase):
              return
      except Exception:
          return
      # yes, so let's collect it
      return UnitTestCase(name, parent=collector)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import traceback
  import _pytest._code
  import pytest
  from _pytest.compat import getimfunc
  from _pytest.config import hookimpl
  from _pytest.outcomes import fail
  from _pytest.outcomes import skip
  from _pytest.outcomes import xfail
  from _pytest.python import Class
  from _pytest.python import Function
label_desc: Use image node_id 1 for calling a global function with example usage: pytest_pycollect_makeitem(collector, name, obj) and returns: UnitTestCase