code: def assert_traceback_matches(self, callback, expected_tb):
      with pytest.raises(Exception) as exc_info:
          callback()
  
      tb = format_exception(exc_info.type, exc_info.value, exc_info.tb)
      m = re.search(expected_tb.strip(), "".join(tb))
      assert (
          m is not None
      ), "Traceback did not match:\n\n%s\nexpected:\n%s" % (
          "".join(tb),
          expected_tb,
      )
  
file_path: catboost/contrib/python/Jinja2/py2/tests/test_debug.py
imports: import pickle
  import re
  from traceback import format_exception
  import pytest
  from jinja2 import ChoiceLoader
  from jinja2 import DictLoader
  from jinja2 import Environment
  from jinja2 import TemplateSyntaxError
label_desc: Use image node_id 1 for calling the TestDebug obj's underlying member method code with example usage: obj.assert_traceback_matches(callback, expected_tb) without return types