elixir-lang / elixir

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

Failing assertions in ExUnit teardown aren't reported #2007

Closed pminten closed 10 years ago

pminten commented 10 years ago

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.

pminten commented 10 years ago

Behaviour has been observed in current master (c837d8e1d36b8b043bdc646dfa66e9cea8ae2038) and as far back as tag v0.9.0 (didn't look further).

pminten commented 10 years ago

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.

edgurgel commented 10 years ago

teardown and setup should not have assertions.