[Proposal] Include ExUnit.Case group to the test context.

70 views
Skip to first unread message

Rudolf Manusadzhian

unread,
Apr 15, 2025, 9:45:09 PMApr 15
to elixir-lang-core
Hi there!
Recently we started using :group option for ExUnit in a project.

For those tests I have had a setup helper where amongst other things I used to check if tags[:async] is not set to true. Otherwise it would raise an error or print a warning saying that it will introduce a flaky test.
Now I want to be able to check if the test runs in the group, but there is no similar to tags[:async] tag for the value for :group.

I figured that this small change would inject the value of the group to the test context.

In that change :group acts as a reserved word, but only for tests that run in a dedicated group.

I see that it effectively introduces a breaking change, so perhaps some other way we could achieve that goal?

José Valim

unread,
Apr 16, 2025, 1:56:56 AMApr 16
to elixir-l...@googlegroups.com
Please do send a pull request but we should probably call it `test_group`, as I can see it conflicting with groups in existing apps. :) In this case, we don't need to check and raise either.


--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/3301ad7a-22a0-4f8d-ae05-c318c037222an%40googlegroups.com.

Rudolf Manusadzhian

unread,
Apr 16, 2025, 5:46:18 AMApr 16
to elixir-lang-core
Reply all
Reply to author
Forward
0 new messages