When trying to use doctests in Livebook, I get this error:
** (ExUnit.DocTest.Error) #cell:brdghoceywtzil2oxanrzvpyqvy6mdh5: could not retrieve the documentation for module Foo. The BEAM file of the module cannot be accessed
(ex_unit 1.14.0) lib/ex_unit/doc_test.ex:513: ExUnit.DocTest.extract/1
(ex_unit 1.14.0) lib/ex_unit/doc_test.ex:235: ExUnit.DocTest.__doctests__/2
#cell:ex3gg7bj43xze5ovqwpk3rmwtdj3y533:5: (module)
(elixir 1.14.0) src/elixir_compiler.erl:65: :elixir_compiler.dispatch/4
(elixir 1.14.0) src/elixir_compiler.erl:50: :elixir_compiler.compile/3
(elixir 1.14.0) src/elixir_module.erl:379: :elixir_module.eval_form/6
(elixir 1.14.0) src/elixir_module.erl:105: :elixir_module.compile/5
(elixir 1.14.0) src/elixir_lexical.erl:15: :elixir_lexical.run/3
#cell:ex3gg7bj43xze5ovqwpk3rmwtdj3y533:3: (file)
Does anybody have an idea what is wrong? Or is this even supposed to work? It would be really cool if yes.
Example Livebook code:
defmodule Foo do
@doc """
iex> Foo.bar()
"X"
"""
def bar, do: "X"
end
ExUnit.start(auto_run: false)
defmodule FooTest do
use ExUnit.Case, async: false
doctest Foo
end
ExUnit.run()