> Have you tried? > `setup(context), do: Module.function_name(context)`
Oh how Yes, of course, that works perfectly well! I can't believe I never considered it. Cheers! On Sun, Feb 5, 2023 at 12:47 PM 'eksperimental' via elixir-lang-core < elixir-lang-core@googlegroups.com> wrote: > Hi Nikola > > Have you tried? > `setup(context), do: Module.function_name(context)` > > Cheers. > > On Sun, 5 Feb 2023 03:21:12 -0800 (PST) > Nikola Begedin <begedinnik...@gmail.com> wrote: > > > Hello everyone. 1st time writing here. I scanned through the repo > > docs, etc, and I'm not finding a guideline on how to do it. Apologies > > if I'm making a mistake here. > > > > I have a proposal, or at least a question about a potential proposal. > > > > You can always import a function from a module and then use `setup > > :function_name` in a test module. This allows you to reuse setup > > functions across the codebase. > > > > However, at least in the environment I work in, I have a fair amount > > of colleagues who dislike importing things. > > > > So my question is, would a version of setup that allows specifying a > > setup callback via a [module, function], {module, function}, etc, be > > a worthy addition? > > > > Including the arity would be more conventional, of course, but it's a > > bit redundant here. > > > > At quick glance, it does seem feasible, but it changes the API and I > > might be missing other caveats, so I'm not sure. > > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "elixir-lang-core" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/elixir-lang-core/Y6xxU64jtUc/unsubscribe > . > To unsubscribe from this group and all its topics, send an email to > elixir-lang-core+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/63df9755.050a0220.aefc6.fd42SMTPIN_ADDED_MISSING%40gmr-mx.google.com > . > -- 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-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CANG9H8FrMgg_Ec%3Dn22npWAFPjR9MK-W-L_71EBCUJT8XL7MLEg%40mail.gmail.com.