It seems like you are not at all interested in the actual output of MyModule.my_func(123) in your example. In cases like these, the convention in Elixir is usually to return `true` or `:ok`. These could than be asserted in the test, just like normal:
assert MyModule.my_func(123) == :ok
In cases like these, above test is stronger than anything you could test using `refute_raise`.
I can see one problem where assert becomes slightly less practical, which would be when `MyModule.my_func` returns an unpredictable value (such as a random number).
However, even in these cases we can use `assert` to check if the output:
- has the type we expect by using functions like `assert is_integer(myModule.my_func(123))`
- matches one of the possible results using `assert MyModule.my_func(123) in [:foo, :bar, :baz]`
etc.
Of course, non-deterministic tests are bad because when they fail it is hard to reproduce a failure, but that is probably a topic for another conversation.
In summary: I do not think that `refute_raise` is useful, since we can easily write more specific tests that will cover all cases that `refute_raise` would cover.
Sincerely,
~Wiebe-Marten/Qqwy