No error if import fails unconditionally#108
No error if import fails unconditionally#108bsipocz merged 2 commits intoscientific-python:masterfrom
Conversation
saimn
left a comment
There was a problem hiding this comment.
Was about to push the same thing, so yes looks good. Probably the best thing to do for now.
|
I think I've changed my opinion since this morning, and now having this worked around in astropy seems a more right solution, after all collection without optional dependencies should work there, thus this "feature" recovered a few bugs already. |
|
As discussed offline, I have no strong feeling either way. |
|
I think the correct fix is to collect doctests without importing files, instead e.g. parsing files with ast or something similar to find docstrings. |
How does the |
|
pytest's doctest does the exact same we had here for 0.6.0 in #103: |
|
Sorry, my question in #108 (comment) is a reply to #108 (comment) . (I clarified my comment above.) |
|
oh, I assumed the first one was a question. |
|
Let's go ahead with this one for now, and maybe #110 for the future. I'm merging this now, but they may be some more outstanding issues, as using this with pytest 5.4, there are still asdf related ModuleNotFoundErrors popping up. |
|
Thank you @pllim! |
|
I haven't caught up with all the notifications yet but I am hoping that maybe astropy/astropy#10260 will handle it. If not, perhaps the last resort is to have |
A hacky but more global fix than astropy/astropy#10242 ? 😬