elixir
elixir copied to clipboard
Failing assertions in ExUnit teardown aren't reported
When an assertion fails in a teardown function this is not reported.
How to reproduce
Put this in a file and run it:
ExUnit.start
defmodule TeardownTest do
use ExUnit.Case
def teardown do
assert 1 == 2
end
test "foo" do
end
end
Expected behaviour
An assertion failure being printed.
Observed behaviour
No errors reported, ExUnit says 1 test has succeeded.
Behaviour has been observed in current master (c837d8e1d36b8b043bdc646dfa66e9cea8ae2038) and as far back as tag v0.9.0 (didn't look further).
Apparently this was a fault on my side, though I'm not exactly sure what it was. Closing this as it isn't an actual bug.
teardown and setup should not have assertions.