   end
 
   @doc """
+  Reigsters a test with the given environment.
+
+  This function is deprecated in favor of register_test/6 which performs
+  better under tight loops by avoiding `__ENV__`.
+  """
+  @doc deprecated: "Use register_test/6 instead"
+  def register_test(%{module: mod, file: file, line: line}, test_type, name, tags) do
+    register_test(mod, file, line, test_type, name, tags)
+  end
+
+  @doc """
   Registers a new attribute to be used during `ExUnit.Case` tests.
 
   The attribute values will be available through `context.registered`.


    var = Macro.escape(var)
    contents = Macro.escape(contents, unquote: true)

    quote bind_quoted: [var: var, contents: contents, message: message] do
      name = ExUnit.Case.register_test(__ENV__, :test, message, [])
      def unquote(name)(unquote(var)), do: unquote(contents)
    end
  end


  """
  defmacro test(message) do
    %{module: mod, file: file, line: line} = __CALLER__

    quote bind_quoted: binding() do
      name = ExUnit.Case.register_test(mod, file, line, :test, message, [:not_implemented])
      def unquote(name)(_), do: flunk("Not implemented")
    end
  end
