 
   defp run_test(opts, config, test, context) do
     ref = make_ref()
+
     try do
       ExUnit.CaptureLog.capture_log(opts, fn ->
-        send self(), {ref, spawn_test(config, test, context)}
+        send(self(), {ref, spawn_test(config, test, context)})
       end)
     catch
       :exit, :noproc ->
         message =
           "could not run test, it uses @tag :capture_log" <>
-          " but the :logger application is not running"
+            " but the :logger application is not running"
+
         %{test | state: failed(:error, RuntimeError.exception(message), [])}
     else
       logged ->

  defp configure(opts) do
    opts = normalize_opts(opts)

    {:ok, manager} = EM.start_link
    {:ok, stats} = EM.add_handler(manager, ExUnit.RunnerStats, opts)
    Enum.each opts[:formatters], &EM.add_handler(manager, &1, opts)

    config = %{
      capture_log: opts[:capture_log],

  end

  defp failed(:error, %ExUnit.MultiError{errors: errors}, _stack) do
    errors =
      Enum.map(errors, fn {kind, reason, stack} ->
        {kind, Exception.normalize(kind, reason), prune_stacktrace(stack)}
      end)
      
    {:failed, errors}
  end

  defp failed(kind, reason, stack) do
    {:failed, [{kind, Exception.normalize(kind, reason), stack}]}
  end

  defp pruned_stacktrace, do: prune_stacktrace(System.stacktrace())

  # Assertions can pop-up in the middle of the stack
  defp prune_stacktrace([{ExUnit.Assertions, _, _, _} | t]), do: prune_stacktrace(t)
