     in_fixture "no_mixfile", fn ->
       write_no_func()
 
-      assert_warn_no_func fn ->
+      assert_warn_no_func(fn ->
         assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
-        assert {:error, [%Mix.Task.Compiler.Diagnostic{
-          severity: :error
-        }]} = Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"])
-      end
+        assert {:error, [diagnostic]} = Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"])
+        assert %Mix.Task.Compiler.Diagnostic{severity: :error} = diagnostic
+      end)
     end
   end
 
   test "does not return error status if warnings-as-errors and no warnings" do
     in_fixture "no_mixfile", fn ->
-      assert_no_warn fn ->
+      assert_no_warn(fn ->
         assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
         assert Mix.Tasks.Compile.Xref.run(["--warnings-as-errors"]) == {:noop, []}
-      end
+      end)
     end
   end
 

    in_fixture "no_mixfile", fn ->
      write_no_func()

      assert_warn_no_func fn ->
        assert Mix.Tasks.Compile.Elixir.run([]) == {:ok, []}
        assert {:noop, [_]} = Mix.Tasks.Compile.Xref.run([])
      end

      assert_no_warn fn ->
        assert {:noop, [_]} = Mix.Tasks.Compile.Xref.run([])
      end

      Mix.Task.reenable("xref")

      assert_warn_no_func fn ->
        assert {:noop, [_]} = Mix.Tasks.Compile.Xref.run(["--force"])
      end
    end
  end



      Mix.Task.reenable("xref")

      assert_warn_no_func(fn -> assert {:noop, [_]} = Mix.Tasks.Compile.Xref.run([]) end)
    end
  end

