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

WarningsCapture raises TypeError on warnings.warn #2233

Closed
d-chambers opened this issue Oct 8, 2018 · 0 comments · Fixed by #2234
Closed

WarningsCapture raises TypeError on warnings.warn #2233

d-chambers opened this issue Oct 8, 2018 · 0 comments · Fixed by #2234
Milestone

Comments

@d-chambers
Copy link
Member

The WarningsCapture class in obspy.core.util.testing raises a TypeError when used with the warnings.warn function. For example:

import warnings

from obspy.core.util.testing import WarningsCapture

with WarningsCapture() as w:
    warnings.warn('something bad is happening')

This occurs because the category parameter can be none, but is not properly checked for if the message parameter is not an instance of Warning.

@megies megies added this to the 1.2.0 milestone Oct 9, 2018
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 a pull request may close this issue.

2 participants