Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check documentation examples with doctest or xdoctest #97

Closed
sverhoeven opened this issue Apr 7, 2021 · 2 comments
Closed

Check documentation examples with doctest or xdoctest #97

sverhoeven opened this issue Apr 7, 2021 · 2 comments
Assignees

Comments

@sverhoeven
Copy link
Member

In the docstrings of the code or in Rst files in docs/ directory you can have code examples.

To make sure those examples actually work they can be reformatted into test snippets and run using a Sphinx extension (https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html) or with Pytest plugin (https://github.com/Erotemic/xdoctest#using-the-pytest-interface).

For example in matchms the Sphinx build also runs the doc tests at https://github.com/matchms/matchms/blob/5497b7363af1d555b8d1ab0162e01458ac7fbf53/.github/workflows/CI_build.yml#L129

@sverhoeven sverhoeven self-assigned this May 6, 2021
@sverhoeven sverhoeven mentioned this issue May 6, 2021
@fdiblen
Copy link
Member

fdiblen commented May 7, 2021

done in #287

@fdiblen fdiblen closed this as completed May 7, 2021
@sverhoeven
Copy link
Member Author

Run by doctest in CI or README.dev.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants