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

Use doctest to test documentation code examples #1438

Open
thorbjoernl opened this issue Dec 3, 2024 · 0 comments
Open

Use doctest to test documentation code examples #1438

thorbjoernl opened this issue Dec 3, 2024 · 0 comments
Labels
documentation 📖 Everything related to code documentation, tutorials and examples testing

Comments

@thorbjoernl
Copy link
Collaborator

thorbjoernl commented Dec 3, 2024

Is your feature request related to a problem? Please describe.
The Pyaerocom documentation contains a number of code examples as a part of its documentation, however we currently have no way of verifying that they work, or that they will work in the future.

I suggest we add doctest to include these snippets to the existing testing pipeline (maybe we could even rewrite the tutorials so they are tested?)

This would ensure that:

  • Code examples are self-contained.
  • That code examples produce the expected output also in future versions of Pyaerocom.
  • It may improve test coverage.

Describe the solution you would like to see

  • Would you be able to work on this solution yourself? Sure
  • How can the Pyaerocom development team assist you?

Additional context

  • Setting up the testing is pretty trivial but I suspect it will be quite some work to get existing code examples to work correctly.
  • Benchmark
@thorbjoernl thorbjoernl added testing documentation 📖 Everything related to code documentation, tutorials and examples labels Dec 3, 2024
@thorbjoernl thorbjoernl changed the title Use doctest to test documentation code example snippets Use doctest to test documentation code examples Dec 3, 2024
@thorbjoernl thorbjoernl mentioned this issue Dec 3, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📖 Everything related to code documentation, tutorials and examples testing
Projects
None yet
Development

No branches or pull requests

1 participant