code: def test_asdict_does_not_return_dict(self):
      if not mock:
          if hasattr(unittest, "SkipTest"):
              raise unittest.SkipTest("unittest.mock required")
          else:
              print("unittest.mock not available")
              return
      fake = mock.Mock()
      self.assertTrue(hasattr(fake, "_asdict"))
      self.assertTrue(callable(fake._asdict))
      self.assertFalse(isinstance(fake._asdict(), dict))
      # https://github.com/simplejson/simplejson/pull/284
      # when running under a debug build of CPython (COPTS=-UNDEBUG)
      # a C assertion could fire due to an unchecked error of an PyDict
      # API call on a non-dict internally in _speedups.c.  Without a debug
      # build of CPython this test likely passes either way despite the
      # potential for internal data corruption.  Getting it to crash in
      # a debug build is not always easy either as it requires an
      # assert(!PyErr_Occurred()) that could fire later on.
      with self.assertRaises(TypeError):
          json.dumps(
              {23: fake}, namedtuple_as_object=True, for_json=False
          )
  
imports: from __future__ import absolute_import
  import unittest
  import simplejson
  from simplejson.compat import StringIO
label_desc: Use image node_id 8 for calling the TestNamedTuple obj's underlying member method code with example usage: obj.test_asdict_does_not_return_dict() without return types