def METHOD_NAME(method, nproc):
  exception_seen = False
  from libtbx.easy_mp import parallel_map
  import traceback
  try:
    results = parallel_map(
      func=_may_divide_by_zero,
      iterable=[2,1,0],
      method=method,
      processes=nproc,
      preserve_exception_message=True)
  except ZeroDivisionError as e:
    exception_seen = True
    exc_type, exc_value, exc_traceback = sys.exc_info()
    assert "division by zero" in str(exc_value), "Exception value mismatch: '%s'" % exc_value
    stack_contains_fail_function = False
    # Two options: Either the original stack is available directly
    for (filename, line, function, text) in traceback.extract_tb(exc_traceback):
      if function == _may_divide_by_zero.__name__:
        stack_contains_fail_function = True
    # or it should be preserved in the string representation of the exception
    from libtbx.scheduling import stacktrace
    ex, st = stacktrace.exc_info()
    if ex is not None and _may_divide_by_zero.__name__ in "".join( st ):
      stack_contains_fail_function = True
    if not stack_contains_fail_function:
      print("Thrown exception: %s:" % str(e))
      traceback.print_tb(exc_traceback)
      print("")
      assert stack_contains_fail_function, "Stacktrace lost"
  except Exception as e:
    print("Exception type mismatch, expected ZeroDivisionError")
    raise
  assert exception_seen, "Expected exception not thrown"