Using setup and foreach in eunit tests

3 Jan 2023 13:18 erlang eunit

For when you want to run both per-suite and per-test setup and cleanup in eunit tests.

the_test_() ->
    {setup, fun suite_setup/0, fun suite_cleanup/1,
        {foreach, fun setup/0, fun cleanup/1, [
            % tests go here
        ]}};