Skip doctests in two imported ufuncs#12861
Conversation
🤯 @nstarman , what is this about? astropy/astropy/cosmology/core.py Lines 390 to 407 in cd730f9 |
A lot of FLRW-related stuff has been moved from In a few Astropy releases I'll get rid of the To avoid this raising a warning, a blank |
|
How can adding a |
Adding a |
|
Well, this complicate things... |
|
To avoid this raising a warning, a blank e.g. in __doctest_skip__ = [] # TODO! remove this when __getattr__ is removed. |
Ah, there's a precedent for this in astropy/astropy/cosmology/core.py Line 27 in cd730f9 |
|
I cherry-picked the commits here onto #12853 . We will see... 🤞 |
|
Please also cherry-pick 3f5797e. |
| from .test_core import CosmologySubclassTest as CosmologyTest | ||
| from .test_core import FlatCosmologyMixinTest, ParameterTestMixin, invalid_zs, valid_zs | ||
|
|
||
| __doctest_skip__ = ['ellipkinc', 'hyp2f1'] |
There was a problem hiding this comment.
Test file too? I don't know how I feel about this. I feel like we are abusing __doctest_skip__.
There was a problem hiding this comment.
Well, there is nothing about a ufunc that you can find out by introspection to determine the module it was declared in.
There was a problem hiding this comment.
I get that a ufunc can't be introspected, but how does pytest-doctestplus pick up the test file in the first place? Shouldn't they skipped because they aren't doctested?
There was a problem hiding this comment.
Those two ufuncs do have doctests in their docstrings.
There was a problem hiding this comment.
Sorry for the confusion, I meant I thought pytest-doctestplus filtered out test files ab initio, but I guess that's not the case?
There was a problem hiding this comment.
Come again? I'm sorry, I didn't understand your question.
There was a problem hiding this comment.
I presumed when pytest-doctestplus was assembling the list of docstrings it needed to check, it would skip over test files. E.g.
module/
file.py
tests/ # skipped
test_file.py # skipped, so it doesn't matter if there's a ufunc inside
There was a problem hiding this comment.
Oh, that's probably a good idea. But I doubt that even pytest does that by default, does it?
|
@lpsinger , do we still need this in light of recent development over at scientific-python/pytest-doctestplus#175 ? |
No. |
|
Shall we close this one, then? |
|
Sure. Thanks! |
See #12853, scientific-python/pytest-doctestplus#175