alias Ecto.Adapters.SQL.Sandbox ExUnit.start(capture_log: true) Sandbox.mode(Microwaveprop.Repo, :manual) Sandbox.mode(Microwaveprop.AprsRepo, :manual) # Silence sandbox-cleanup disconnect noise. When a test process exits # while still owning a Postgrex connection, the protocol logs an # `[error] Postgrex.Protocol ... disconnected: ... client #PID<...> # exited`. It's benign — the connection is being torn down on purpose # — but at :error level it bypasses `capture_log: true` (which only # captures logs from the test process). Pinning these modules to # :critical drops the noise without affecting real DB error logging. Logger.put_module_level( [Postgrex.Protocol, DBConnection.Connection], :critical ) Mox.defmock(Microwaveprop.Valkey.MockAdapter, for: Microwaveprop.Valkey.Adapter)