       raise ArgumentError, "cannot register attribute #{inspect(name)} multiple times"
     end
 
-    if Module.get_attribute(mod, name) do
+    if Module.has_attribute?(mod, name) do
       raise "you must set @#{name} after it has been registered"
     end
   end

        {attribute, Module.get_attribute(mod, attribute)}
      end

    tag = Module.delete_attribute(mod, :tag)
    async = Module.get_attribute(mod, :ex_unit_async)


    quote do
      async = !!unquote(opts)[:async]

      unless Module.has_attribute?(__MODULE__, :ex_unit_tests) do
        tag_check =
          [:moduletag, :describetag, :tag]
          |> Enum.any?(&Module.has_attribute?(__MODULE__, &1))

        if tag_check do
          raise "you must set @tag, @describetag, and @moduletag after the call to \"use ExUnit.Case\""
