diff --git a/lib/ex_unit/lib/ex_unit/case.ex b/lib/ex_unit/lib/ex_unit/case.ex index f72160711c9..6af10d22b3d 100644 --- a/lib/ex_unit/lib/ex_unit/case.ex +++ b/lib/ex_unit/lib/ex_unit/case.ex @@ -940,9 +940,19 @@ defmodule ExUnit.Case do defp normalize_tags(tags) do Enum.reduce(Enum.reverse(tags), %{}, fn - {key, value}, acc -> Map.put(acc, key, value) - tag, acc when is_atom(tag) -> Map.put(acc, tag, true) - tag, acc when is_list(tag) -> Enum.into(tag, acc) + {key, value}, acc -> + Map.put(acc, key, value) + + tag, acc when is_atom(tag) -> + Map.put(acc, tag, true) + + tag, acc -> + if Keyword.keyword?(tag) do + Enum.into(tag, acc) + else + raise "an invalid value for a tag was used. " <> + "Expected an atom or a keyword list, got: #{inspect(tag)}" + end end) end end