Skip to content

Commit

Permalink
Add note about doctests in docstrings (#1265)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
helgee authored Mar 23, 2020
1 parent 470cf55 commit e71b24d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/src/man/doctests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit e71b24d

@mortenpi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Bugfix release. The changes are documented in the CHANGELOG.md file.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/11387

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.24.7 -m "<description of version>" e71b24dcad16dd1280e347b80d6b0feaf211a2a7
git push origin v0.24.7

Please sign in to comment.