code: def test_invalid_encode_exception(self):
      with self.assertRaises(TypeError):
          _json.dumps({"a": {1}}, cls=PlotlyJSONEncoder)
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_utils/test_utils.py
imports: from unittest import TestCase
  from plotly.utils import PlotlyJSONEncoder, get_by_path, node_generator
  import json
label_desc: Use image node_id 2 for calling the TestJSONEncoder obj's underlying member method code with example usage: obj.test_invalid_encode_exception() without return types