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

Test code examples in docs #387

Merged
merged 1 commit into from
Feb 6, 2024
Merged

Test code examples in docs #387

merged 1 commit into from
Feb 6, 2024

Conversation

greschd
Copy link
Member

@greschd greschd commented Feb 5, 2024

Add the sphinx.ext.doctest plugin to the documentation, and run the
doctest check in a separate CI job to ensure the code examples in
the docs are working.

Closes #384

@greschd greschd force-pushed the maint/add_doctest branch 3 times, most recently from d5104ca to 7f134e3 Compare February 5, 2024 12:16
@@ -201,6 +201,86 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
if: matrix.python-version == '3.9' && github.ref == 'refs/heads/main'

doctest:
Copy link
Member Author

Choose a reason for hiding this comment

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

Could also be done as part of one of the other jobs, but since the purpose is somewhat different from both doc and test jobs, I decided to create a separate job.

@@ -37,16 +37,36 @@ Load a model

To load a model in ACP, use the :meth:`import_model <.ACP.import_model>` method:

.. code-block:: python
.. testcode::
:hide:
Copy link
Member Author

Choose a reason for hiding this comment

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

Upload of the file to the server is hidden; the tempfile is used just to rename the file.

@greschd greschd marked this pull request as ready for review February 5, 2024 12:30
@greschd greschd merged commit e0c7db6 into main Feb 6, 2024
12 checks passed
@greschd greschd deleted the maint/add_doctest branch February 6, 2024 12:21
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

Successfully merging this pull request may close these issues.

Add automated testing of code in documentation
2 participants