Make sure test collection doesn't crash if there are import errors#10242
Closed
astrofrog wants to merge 2 commits intoastropy:masterfrom
Closed
Make sure test collection doesn't crash if there are import errors#10242astrofrog wants to merge 2 commits intoastropy:masterfrom
astrofrog wants to merge 2 commits intoastropy:masterfrom
Conversation
pllim
approved these changes
Apr 30, 2020
Member
|
Could we rather have this as a default in pytest-doctestplus and rather opt in into import errors? |
Member
|
Tests ran. There is a new error about existing file but at least collection is fine. |
Contributor
|
I saw that too, and pushed a change that should fix it (at least for doctextplus 0.6). |
Member
|
I think, now I'm more in favour of this (scientific-python/pytest-doctestplus#108 (comment)). After all #10246 seems to be a legit collection of bugs. Then we can hope that at some point we'll be able to remove the |
bsipocz
approved these changes
Apr 30, 2020
Member
Author
|
Closing in favor of #10358 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It looks like we now need to specify the
--doctest-ignore-import-errorsflag to avoid issues when collecting tests - this is due to a change in https://github.com/astropy/pytest-doctestplus/pull/103/files#diff-ebe8cdb0141ee1407c94011e34737c5dR171-R174 which doesn't add the flag as such (it's a pytest flag) but makes pytest-doctestplus properly take it into account.@saimn - is this intentional, or should the default still somehow be to skip on import errors? If the fix here is needed, we could use batchpr to automatically update packages that have
doctest_plus = enabled.