So for anyone having a similar issue you can import ExUnit.Callbacks and it should do the trick.
My support module (test/support/my_app_mock.ex) now looks something like this
defmodule MyApp.Mock do
import ExUnit.Callbacks
def set_scaffold(_context) do
start_supervised(MyApp.MyModule.Supervisor)
start_supervised({Registry, keys: :unique, name: MyApp.Registry.ById})
...
:ok
end
end
And then it can be used like
...
import MyApp.Mock
setup :set_scaffold
Just don’t forget to add the path to the compilation path list (example here)






















