Repository navigation
Fix astropy.io.votable tests that fail when run on installed package - #11677
Merged
Merged
Conversation
Member
|
I don't think the warnings here rely on |
pllim
reviewed
Apr 30, 2021
|
|
||
| # Exercise the checks in __init__ | ||
| with pytest.raises(AstropyDeprecationWarning): | ||
| with pytest.warns(AstropyDeprecationWarning): |
pllim
approved these changes
Apr 30, 2021
pllim
left a comment
Member
There was a problem hiding this comment.
Yes, you are right. It only emits warning and ignores config (unless config tells it to ignore, lol). Fixing that behavior is out of scope.
I didn't notice because I assumed config would be respected and pytest was turning it into error anyway. Good catch!
| # Invalid versions | ||
| for bversion in (b'1.0', b'2.0'): | ||
| with pytest.raises(W21): | ||
| with pytest.warns(W21): |
Member
There was a problem hiding this comment.
astropy/astropy/io/votable/tree.py
Line 3589 in 6c168d9
| </VOTABLE> | ||
| ''' | ||
| with pytest.raises(W41): | ||
| with pytest.warns(W41): |
Member
There was a problem hiding this comment.
astropy/astropy/io/votable/tree.py
Line 3595 in 6c168d9
Contributor
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.
Description
This pull request is to address failing tests in the astropy.io.votable module when run on non-editable install of astropy. The problem is that setup.cfg doesn't exist in site-packages/astropy, so warnings are not converted to exceptions there. Asserting with pytest.warns works for both editable and non-editable installs.