class_docstr: Test codehilite extension. 
class_docstr_tok: ["Test","codehilite","extension","."]
code: def setUp(self):
      if (
          has_pygments
          and pygments.__version__ != required_pygments_version
      ):
          self.skipTest(
              f"Pygments=={required_pygments_version} is required"
          )
  
      # Define a custom Pygments formatter (same example in the documentation)
      if has_pygments:
  
          class CustomAddLangHtmlFormatter(
              pygments.formatters.HtmlFormatter
          ):
              def __init__(self, lang_str="", **options):
                  super().__init__(**options)
                  self.lang_str = lang_str
  
              def _wrap_code(self, source):
                  yield 0, f'<code class="{self.lang_str}">'
                  yield from source
                  yield 0, "</code>"
  
      else:
          CustomAddLangHtmlFormatter = None
  
      self.custom_pygments_formatter = CustomAddLangHtmlFormatter
  
imports: from markdown.test_tools import TestCase
  from markdown.extensions.codehilite import CodeHiliteExtension, CodeHilite
  from markdown import extensions, treeprocessors
  import os
  import xml.etree.ElementTree
label_desc: Use image node_id 1 for calling the TestCodeHiliteExtension obj's underlying member method code with example usage: obj.setUp() without return types