From 7f3bd109fc5f3759b4f1d03f3f5e37695507d77b Mon Sep 17 00:00:00 2001 From: Steffen Deusch Date: Thu, 19 Feb 2026 18:36:54 +0100 Subject: [PATCH] Fail when misnamed test files are detected and --warnings-as-errors is set Closes https://github.com/elixir-lang/elixir/issues/15105. --- lib/mix/lib/mix/tasks/test.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mix/lib/mix/tasks/test.ex b/lib/mix/lib/mix/tasks/test.ex index 7e87a2fba2..e875eaade6 100644 --- a/lib/mix/lib/mix/tasks/test.ex +++ b/lib/mix/lib/mix/tasks/test.ex @@ -714,7 +714,8 @@ defmodule Mix.Tasks.Test do cover && cover.() cond do - warnings_as_errors? and (warnings? or helper_warned?) and failures == 0 -> + warnings_as_errors? and (warnings? or helper_warned? or warn_files != []) and + failures == 0 -> message = "\nERROR! Test suite aborted after successful execution due to warnings while using the --warnings-as-errors option"