code: def test_format_exception_with_cause():
      try:
          makeitraise()
      except Exception as e:
          assert_equal(
              format_exception_with_cause(e),
              "RuntimeError -caused by- ValueError -caused by- Mike",
          )
          # make sure it also works with TracebackException/CapturedException:
          ce = CapturedException(e)
          assert_equal(
              ce.format_with_cause(),
              "RuntimeError -caused by- ValueError -caused by- Mike",
          )
  
imports: from unittest.mock import patch
  from datalad import cfg
  from datalad.support.exceptions import CapturedException, format_exception_with_cause
  from datalad.tests.utils_pytest import assert_equal, assert_re_in, assert_true
label_desc: Use image node_id 3 for calling a global function with example usage: test_format_exception_with_cause() without return types