code: def test_find_tests_socket(self):
      # A socket is neither a directory nor a regular file.
      # https://bugs.python.org/issue25320
      loader = unittest.TestLoader()
  
      original_listdir = os.listdir
  
      def restore_listdir():
          os.listdir = original_listdir
  
      original_isfile = os.path.isfile
  
      def restore_isfile():
          os.path.isfile = original_isfile
  
      original_isdir = os.path.isdir
  
      def restore_isdir():
          os.path.isdir = original_isdir
  
      path_lists = [["socket"]]
      os.listdir = lambda path: path_lists.pop(0)
      self.addCleanup(restore_listdir)
  
      os.path.isdir = lambda path: False
      self.addCleanup(restore_isdir)
  
      os.path.isfile = lambda path: False
      self.addCleanup(restore_isfile)
  
      loader._get_module_from_name = lambda path: path + " module"
      orig_load_tests = loader.loadTestsFromModule
  
      def loadTestsFromModule(module, pattern=None):
          # This is where load_tests is called.
          base = orig_load_tests(module, pattern=pattern)
          return base + [module + " tests"]
  
      loader.loadTestsFromModule = loadTestsFromModule
      loader.suiteClass = lambda thing: thing
  
      top_level = os.path.abspath("/foo")
      loader._top_level_dir = top_level
      suite = list(loader._find_tests(top_level, "test*.py"))
  
      self.assertEqual(suite, [])
  
imports: import os.path
  from os.path import abspath
  import re
  import sys
  import types
  import pickle
  from test import support
  from test.support import import_helper
  import unittest
  import unittest.mock
  import test.test_unittest
label_desc: Use image node_id 3 for calling the TestDiscovery obj's underlying member method code with example usage: obj.test_find_tests_socket() and returns: unknown