stefanluptak
Doctests in Livebook not working
Hi everybody! ![]()
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()
Marked As Solved
bmitc
This is a known issue and is already fixed in Livebook’s main branch, but it hasn’t made it into a release yet.
https://github.com/livebook-dev/livebook/issues/1563
I recently filed this issue and found all this out. ![]()
3
Also Liked
stefanluptak
FYI, it’s released now in the version 0.8.0.
https://github.com/livebook-dev/livebook/blob/main/CHANGELOG.md#v080-2022-12-08
1
Popular in Questions
I have an umbrella app.
Some of the apps inside depend on other apps in the umbrella, unsurprisingly.
I’m writing a test for one of the...
New
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
What is the idiomatic way of matching for not nil in Elixir?
E.g.,
First way:
defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Hello, I have map which I want to convert it to string like this:
the map:
%{last_name: "tavakkoli", name: "shahryar"}
the string I ne...
New
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
Hi,
I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Other popular topics
Hi All,
I set a environment variables in dev.exs , like below code.
when i start server, how can i set the ${enable} value?
thanks.
d...
New
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode.
The solution seems to be, in a hyphena...
New
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
New
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Hi there,
I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
Update:
How to use the Blogs & Podcasts section
You can post links to your blog posts or podcasts either in one of the Official Blog...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








