EXP: Run test suite with dev pytest-doctestplus#12853
EXP: Run test suite with dev pytest-doctestplus#12853pllim wants to merge 2 commits intoastropy:mainfrom
Conversation
|
👋 Thank you for your draft pull request! Do you know that you can use |
|
Why not permanently add this to devdeps? |
|
I guess we could... Will add it to infrastructure agenda. |
|
Failure looks related. But what do we do, @lpsinger or @mhvk ? |
|
The failing doctest is in Numpy itself, here. This is proof that we are now discovering tests in ufuncs! 🤣 The question is, why is pytest discovering tests in Numpy? |
This should fix the CI failure in astropy#12853.
|
#12858 should fix this. |
|
What about these new errors? |
|
Hmm, there are several Astropy modules that have |
|
But |
|
So having this new pytest-doctestplus plugin means we have to be real careful of imports? I think this should be documented in the dev docs then. When to import globally and when not to. |
|
@lpsinger - the fact that most imports are local is almost certainly because scipy is not (yet) a required dependency for most of astropy. But for cosmology it is, hence the imports on top. I'm starting to wonder a bit if the gain is worth the pain... Maybe after all there should be a switch on doctestplus to turn off ufunc doc tests? Of course, really the ufuncs should expose the module they are defined in! |
|
OK, try #12861 and scientific-python/pytest-doctestplus#175. |
Agreed. And instead of having to have |
Or we could make the ufunc doctest discovery an opt-in using a |
|
Yes, so at least now we found the drawback of activating it by default ;). The problem with the global switch is that we would face the same issue if we want to use it in Astropy. So, since ufunc can be doctested only if imported in another module (I think ?), maybe a module level directive (e.g. |
|
So... what is the path forward here? |
|
I think we are all agreed that doctesting ufuncs is a good idea. The question is whether we want to opt in or opt out of testing specific files.
I actually think the optimal solution is a |
|
I agree; I like |
|
Rebased and dropped the cherry-picks. 🤞 |
|
21/21 = 💯 🎉 |
|
For those interested: |
Description
This pull request is to see if scientific-python/pytest-doctestplus#174 broke anything here.
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.