New feature, and potentially breaking change: Add the failing parameter line to the backtrace when a test fails
This change lets each param_test
/param_feature
carry forward the context of which row in your parameters table it's executing. Then, when the test fails, it will add that line of the file to the backtrace printed by ExUnit, along with the text of the row.
For instance, consider this test that will fail 100% of the time:
param_test "gives the failing parameter row when a test fails",
"""
| should_fail? | description |
| false | "Works" |
| true | "Breaks" |
""",
%{should_fail?: should_fail?} do
refute should_fail?
end
When you run this, you'll get an ExUnit backtrace that looks like this:
1) test gives the failing parameter row when a test fails - Breaks (ParameterizedTest.BacktraceTest)
test/parameterized_test/backtrace_test.exs:1
Expected truthy, got false
code: assert not should_fail?
stacktrace:
test/parameterized_test/backtrace_test.exs:8: (test)
test/parameterized_test/backtrace_test.exs:5: ParameterizedTest.BacktraceTest."| true | \"Breaks\" |"/0
This should make it easier to figure out which of your parameter rows caused the failing test.
This is a breaking change if and only if you were using the included sigil (~PARAMS
for Elixir v1.15+, or ~x
for Elixir v1.14) as something other than an argument to param_test
/param_feature
, which you probably were not.
Important bug fix: Support @tag
module attributes applied to param_test
or param_feature
blocks
This bug has been there from the beginning, and was making it so that @tag
s you thought were applying to all the parameterized tests in a block were in fact only applying to the first set of parameters.
Miscellaneous changes
- Bump dialyxir from 1.4.4 to 1.4.5 by @dependabot in #34
- Bump ex_doc from 0.34.2 to 0.35.0 by @dependabot in #35
- Bump ex_doc from 0.35.0 to 0.36.0 by @dependabot in #37
- Bump ex_doc from 0.36.0 to 0.36.1 by @dependabot in #38
- Bump credo from 1.7.10 to 1.7.11 by @dependabot in #43