code: def test_discovery_failed_discovery(self):
      from test.test_importlib import util
  
      loader = unittest.TestLoader()
      package = types.ModuleType("package")
  
      def _import(packagename, *args, **kwargs):
          sys.modules[packagename] = package
          return package
  
      with unittest.mock.patch("builtins.__import__", _import):
          # Since loader.discover() can modify sys.path, restore it when done.
          with import_helper.DirsOnSysPath():
              # Make sure to remove 'package' from sys.modules when done.
              with util.uncache("package"):
                  with self.assertRaises(TypeError) as cm:
                      loader.discover("package")
                  self.assertEqual(
                      str(cm.exception),
                      "don't know how to discover from {!r}".format(
                          package
                      ),
                  )
  
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 26 for calling the TestDiscovery obj's underlying member method code with example usage: obj.test_discovery_failed_discovery() and returns: package