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

Fix code snippets in documentation for doctest #1440

Merged
merged 8 commits into from
Feb 17, 2025
Merged

Conversation

thorbjoernl
Copy link
Collaborator

@thorbjoernl thorbjoernl commented Dec 3, 2024

Change Summary

Adds support for doctest and ensures all doctests pass locally. Note that since the doctests examples rely on lustre data, they have not been enabled for the CI testing.

To run doctest when running tests locally add --doctest-modules to your pytest invocation (ie. pytest --doctest-modules)

To have every pytest run use this option automatically, create a pytest.ini with the following content:

[pytest]
addopts = --doctest-modules

Related issue number

closes #1438

Checklist

  • Start with a draft-PR
  • The PR title is a good summary of the changes
  • PR is set to AeroTools and a tentative milestone
  • Documentation reflects the changes where applicable
  • Tests for the changes exist where applicable
  • Tests pass locally
  • Tests pass on CI
  • At least 1 reviewer is selected
  • Make PR ready to review

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.33%. Comparing base (3867e4b) to head (f38eec6).
Report is 105 commits behind head on main-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           main-dev    #1440      +/-   ##
============================================
- Coverage     78.49%   78.33%   -0.17%     
============================================
  Files           140      140              
  Lines         21299    21413     +114     
============================================
+ Hits          16719    16773      +54     
- Misses         4580     4640      +60     
Flag Coverage Δ
unittests 78.33% <ø> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lewisblake
Copy link
Member

Once #1439 fixed, this should be easier, but still a pretty big task

@lewisblake lewisblake added this to the m2025-03 milestone Feb 3, 2025
@thorbjoernl thorbjoernl changed the title Doctest Fix code snippets in documentation for doctest Feb 10, 2025
@thorbjoernl thorbjoernl added testing documentation 📖 Everything related to code documentation, tutorials and examples labels Feb 10, 2025
@thorbjoernl thorbjoernl marked this pull request as ready for review February 10, 2025 12:36
Copy link
Member

@lewisblake lewisblake left a comment

Choose a reason for hiding this comment

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

LGTM

@lewisblake lewisblake merged commit cc7ee22 into main-dev Feb 17, 2025
7 of 8 checks passed
@lewisblake lewisblake deleted the doctest-benchmark branch February 17, 2025 10:04
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

Successfully merging this pull request may close these issues.

Use doctest to test documentation code examples
2 participants