From 3d7e59a82b1eb75059b35debce4631a86492ab7a Mon Sep 17 00:00:00 2001 From: Helge Eichhorn Date: Fri, 20 Mar 2020 16:44:19 +0100 Subject: [PATCH 1/2] Add note about doctests in docstrings 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..bc3ec18c8f 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 + Please make sure to include all 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 From 6d73d619458db79cd949074062958642d8629683 Mon Sep 17 00:00:00 2001 From: Helge Eichhorn Date: Sun, 22 Mar 2020 06:27:28 +0100 Subject: [PATCH 2/2] Update docs/src/man/doctests.md Co-Authored-By: Morten Piibeleht --- docs/src/man/doctests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/man/doctests.md b/docs/src/man/doctests.md index bc3ec18c8f..52561b88b2 100644 --- a/docs/src/man/doctests.md +++ b/docs/src/man/doctests.md @@ -238,7 +238,7 @@ makedocs(modules=[MyPackage], ...) ``` !!! note - Please make sure to include all modules that contain docstrings with doctests in the + 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