-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Running doctests using doctest-plus #4117
Running doctests using doctest-plus #4117
Conversation
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Still working on latexify error. |
I think it makes sense to skip the failing doctest. The functionality is being tested in the unit tests, and testing through a doctest whether a PNG or the LaTeX form of an equation can be printed out or not is quite inconvenient. Please see https://github.com/scientific-python/pytest-doctestplus#skipping-tests for instructions. |
Makes sense. Skipping these tests. |
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
The doctests failed because of the now redundant |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I added a few suggestions plus a fix for the failing doctest. Thanks, @prady0t!
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
Looks like there's another one of the |
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Done! |
Test failure due to non-matching hashes happens quite frequently. Why does it happen? Is there a way to fix it?
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4117 +/- ##
===========================================
+ Coverage 99.55% 99.56% +0.01%
===========================================
Files 288 288
Lines 21790 21790
===========================================
+ Hits 21693 21696 +3
+ Misses 97 94 -3 ☔ View full report in Codecov by Sentry. |
This is a bug with
Either way, a re-run typically fixes the issue, but it's strange that it happens with |
Thanks for your work, @prady0t! |
I see 🤔 So we can't do anything about it for the moment. |
* Adding doctest using doctest-plus Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> * Skipping failing tests Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> * Update run-tests.py Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * style: pre-commit fixes * Removing unrelated subprocess Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> * style: pre-commit fixes * Update docs/source/user_guide/installation/index.rst Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update docs/source/user_guide/installation/index.rst Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Update pybamm/parameters/parameter_sets.py Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> * Fixing doctest directive Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> --------- Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Co-authored-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com> Co-authored-by: Eric G. Kratz <kratman@users.noreply.github.com> Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Arjun Verma <arjunverma.oc@gmail.com>
Description
Running doctests on
/pybamm
using pytest's doctest-plus plugin. We decided to move ahead withdoctestplus
asxdoctest
was throwing random internal errors. See discussion here.Fixes #4031
Also addresses #3617