-
Notifications
You must be signed in to change notification settings - Fork 63
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
Turn ConstPolyRing example into a doctest #1894
Conversation
fa51c45
to
4f815f5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1894 +/- ##
==========================================
+ Coverage 88.14% 88.17% +0.03%
==========================================
Files 120 120
Lines 30288 30302 +14
==========================================
+ Hits 26697 26719 +22
+ Misses 3591 3583 -8 ☔ View full report in Codecov by Sentry. |
... so that we verify it is correct *there*, instead of testing a copy which is out-of-sync
4f815f5
to
90d92bd
Compare
docs/src/ring_interface.md
Outdated
|
||
We can test it like this. | ||
|
||
```jldoctest ConstPoly; filter = r".*" |
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.
So this filter (and the one above in line 1018) is really meant to discard all output. This is because the output in test_EuclideanRing_interface
comes from @testset
. But there is only output if this is the top-most @testset
. But it turns out that depending on how doctests are tested, they may either all be run in a single encompassing @testset
, or not. Thus in one code path Documenter will complain here if I provide example output, and in the other if I don't provide it. The filter is the only one out.
Luckily this does not impeded the effectiveness of this test: If test_EuclideanRing_interface
reports a failure, it still gets reported at least in the case with the encompassing @testset
. I verified this by deliberately breaking one of the methods and checking that doctest
reports this failure.
I think your problem here is that doctestfilters are applied on a per-line basis by default. This means that if you have |
I just tried locally to revert the final hack and use |
Perhaps we can merge it with the gross hack and if one day someone figures out how to do without it, they can submit it as a follow-up? |
I looked into it and adapted the regex in such a way that it works locally without the hack. Let's see if CI agrees. Reasoning: The |
If CI is happy, I am fine with it |
... so that we verify it is correct there, instead of testing a copy which is out-of-sync.
This grew out of PR #1885 where I noticed that the two copies were already out of sync, and since I wanted to be able to test the
show
modifications forConstPolyRing
, which are therefore also included here (in corrected form compared to the untested code I had in #1885).