class Minitest::Test

def new_exception klass, msg, bt, kill = false # :nodoc:

:nodoc:
def new_exception klass, msg, bt, kill = false # :nodoc:
  ne = klass.new msg
  ne.set_backtrace bt
  if kill then
    ne.instance_variables.each do |v|
      ne.remove_instance_variable v
    end
  end
  Marshal.dump ne                           # can raise TypeError
  ne
end