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

[patch] Run Doctest #18

Merged
merged 6 commits into from
Jun 19, 2024
Merged

[patch] Run Doctest #18

merged 6 commits into from
Jun 19, 2024

Conversation

liamhuber
Copy link
Member

Adds automatic testing of the docstring. I cut some corners on the deprecator example because I just couldn't get the output parsing to work nicely with the fact that it is a warning being printed and not plain output.

I can't get the test to nicely see the error message; since we anyhow have unit tests for this I am not hung up on whether the docstrings remain perfectly verbatim correct and am content to leave the printed warning as plain-text docstring instead of tested-code docstring.
Copy link

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_snippets/doctest

Copy link

codacy-production bot commented Jun 18, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+2.88% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bce8017) 451 414 91.80%
Head commit (2dbfdff) 451 (+0) 427 (+13) 94.68% (+2.88%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#18) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences


🚀 Don’t miss a bit, follow what’s new on Codacy.

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@coveralls
Copy link

coveralls commented Jun 18, 2024

Pull Request Test Coverage Report for Build 9570593710

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.0%) to 94.47%

Totals Coverage Status
Change from base Build 9420542945: 3.0%
Covered Lines: 410
Relevant Lines: 434

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 18, 2024

Pull Request Test Coverage Report for Build 9571690727

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.9%) to 94.678%

Totals Coverage Status
Change from base Build 9571433938: 2.9%
Covered Lines: 427
Relevant Lines: 451

💛 - Coveralls

@pmrv
Copy link
Contributor

pmrv commented Jun 19, 2024

@deprecate I'm playing around just now, but it's all a bit awkward. Since there are the unit tests, we could just add #doctest: +SKIP for the examples in the docstring.

@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9581360703

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.9%) to 94.678%

Totals Coverage Status
Change from base Build 9571433938: 2.9%
Covered Lines: 427
Relevant Lines: 451

💛 - Coveralls

Now that doctest ignores it anyway
@coveralls
Copy link

coveralls commented Jun 19, 2024

Pull Request Test Coverage Report for Build 9585341114

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+2.9%) to 94.678%

Totals Coverage Status
Change from base Build 9571433938: 2.9%
Covered Lines: 427
Relevant Lines: 451

💛 - Coveralls

@liamhuber
Copy link
Member Author

@pmrv perfect, thank you! I had been trying to accomplish something similar, but I think I was using #doctest: +IGNORE or some other syntax that was wrong and had talked myself into the idea it didn't work.

Now that you got the skip working, I've reverted my ugly formatting of the expected output.

@liamhuber liamhuber merged commit 553d8d4 into main Jun 19, 2024
18 of 19 checks passed
@liamhuber liamhuber deleted the doctest branch June 19, 2024 16:26
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.

3 participants