Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation warning in tests #124

Merged
merged 1 commit into from
Mar 22, 2017
Merged

Conversation

lesserwhirls
Copy link
Collaborator

We get a validation warning in our test suite due to an attribute added to a catalog that is not under our control.

@dopplershift
Copy link
Member

So.....the presence of that invalid value actually served as a test of the warning code. sigh

@dopplershift
Copy link
Member

How would you feel about using pytest's warning support instead?

@lesserwhirls
Copy link
Collaborator Author

Hmmm...I'd rather add a new test to test_metadata.py that explicitly tests for the warning.

@lesserwhirls
Copy link
Collaborator Author

Oh man...I think I see it now 👎

@dopplershift
Copy link
Member

Separate test is fine, but then you need to swallow the warning in the other test.

@lesserwhirls
Copy link
Collaborator Author

Oops...that comment was for another issue.

Yes, a separate test that triggers and swallows the warning using pytests warning support.

@dopplershift
Copy link
Member

Can you add that here so we don't drop (meaningful) coverage?

@lesserwhirls
Copy link
Collaborator Author

Yep, will do - just need to get aws going again laughs I'm running single threaded tonight.

@lesserwhirls
Copy link
Collaborator Author

So pytest.warns does not seem to play nice with logging.warning - it wants warnings.warn. I seem to recall we discussed logging and warnings at some point, but I can't remember the details.

@dopplershift
Copy link
Member

So it looks like pytest-catchlog is the answer (it's on PyPI and conda-forge). If you're not up for adding it, I can do it.

@lesserwhirls
Copy link
Collaborator Author

I found that, too. I can add it in - I just wanted to talk to you about it before doing so. Let me update the PR.

We get a validation warning in our test suite due to an attribute added to a catalog that is not under our control.
@dopplershift dopplershift merged commit 0c660b0 into Unidata:master Mar 22, 2017
@dopplershift dopplershift modified the milestone: 0.4.1 Mar 31, 2017
@lesserwhirls lesserwhirls deleted the validate branch June 4, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants