melpon/memoize

disable in test env

Closed this issue · 2 comments

Hi,

is there a way to disable memoize in parallel tests?

Thanks,
Philipp

Not implemented in memoize. However you can write below:

if Mix.env() == :test do
  def func() do
    do_func()
  end
else
  defmemo func() do
    do_func()
  end
end

def do_func() do
  ...
end

not the most elegant solution, but the easiest ;)

Thanks,
Philipp