elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.38k stars 3.36k forks source link

Tests using capture_log with level warn no longer pass #12605

Closed lukaszsamson closed 1 year ago

lukaszsamson commented 1 year ago

Elixir and Erlang/OTP versions

Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]

Elixir 1.15.0-rc.0 (d673191) (compiled with Erlang/OTP 25)

Operating system

macOS

Current behavior

Tests with deprecated log level :warn no longer catch anything, capture_log returns empty string

assert capture_log([level: :warn], fn ->
Logger.warn("ABC")
Logger.warning("ABC")
end) =~ "ABC"
Logger - error: {removed_failing_handler,'Elixir.ExUnit.CaptureServer'}

Expected behavior

capture_log should work and emit a warning

josevalim commented 1 year ago

Fix incoming in 3.

sabiwara commented 1 year ago

@josevalim oops I just sent a PR 😅