From e71b24dcad16dd1280e347b80d6b0feaf211a2a7 Mon Sep 17 00:00:00 2001 From: Helge Eichhorn Date: Mon, 23 Mar 2020 05:48:23 +0100 Subject: [PATCH] Add note about doctests in docstrings (#1265) Suggest to add modules with doctests in docstrings to the `modules` argument. Otherwise you get the strange situation where the doctests are not run when running `makedocs` but do run and potentially fail when running `doctest`. --- docs/src/man/doctests.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/src/man/doctests.md b/docs/src/man/doctests.md index 75a96d4318..52561b88b2 100644 --- a/docs/src/man/doctests.md +++ b/docs/src/man/doctests.md @@ -237,6 +237,10 @@ DocMeta.setdocmeta!(MyPackage, :DocTestSetup, :(using MyPackage); recursive=true makedocs(modules=[MyPackage], ...) ``` +!!! note + Make sure to include all (top-level) modules that contain docstrings with doctests in the + `modules` argument to [`makedocs`](@ref). Otherwise these doctests will not be run. + ### Block-level setup code Yet another option is to use the `setup` keyword argument to the `jldoctest` block, which is