TST: Get rid of io.votable test warnings#8756
Conversation
This comment has been minimized.
This comment has been minimized.
| None, name='c', datatype='char', | ||
| config=config) | ||
| with pytest.warns(exceptions.W47): | ||
| field = tree.Field(None, name='c', datatype='char', config=config) |
There was a problem hiding this comment.
Just a general comment - I think it would be nice to make sure in each case that we know why the warning is being raised. Currently if I look at this test it's not clear why this specific line of code should raise say W47, and we need to make sure that it is correct that the warning is being emitted. Why does it warn and not raise an error given the config? Is that expected?
There was a problem hiding this comment.
For this particular line, it is from W47: ?:?:?: W47: Missing arraysize indicates length 1:
...\io\votable\converters.py in __init__(self, field, config, pos)
300
301 if field.arraysize is None:
--> 302 vo_warn(W47, (), config, pos)
303 field.arraysize = '1'
So, this one is okay to ignore. As for the others, sigh, I need to find another day to Sherlock through the warnings...
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
For the deeper design question on how much config should control how all the warnings are handled, I have opened a separate issue at #8775
| field = tree.Field( | ||
| None, name='c', datatype='char', | ||
| config=config) | ||
| field = tree.Field(None, name='c', arraysize='1', datatype='char', |
There was a problem hiding this comment.
So, instead of catching the warning, I fix the call so it does not emit warning in the first place. Is this more desirable, @astrofrog ?
|
|
||
| writeto(votable2, os.path.join(str(tmpdir), "through_table.xml")) | ||
| # W39: Bit values can not be masked | ||
| with pytest.warns(W39): |
There was a problem hiding this comment.
Nothing much I can do here without scope creep. I think it is correct behavior for writer to be more verbose than reader. But I have no desire to fix the data file so that it stops complaining about bit values and masking.
tomdonaldson
left a comment
There was a problem hiding this comment.
I have no concerns with the content or scope of this PR as it stands now.
|
Thanks! |
This should get rid of the rest of
io.votabletest warnings. Follow up of #8715 and as part of work for #7928 . The warnings were captured by removing the line insetup.cfgto suppress pytest warnings and then add this in the same section:And then run tests with
python setup.py -P io.votable. Most of the changes are to handleVOWarningemitted when writing VO table back out or parsing specific fields.