warn category defaults to UserWarning

This commit is contained in:
wiredfool 2014-03-30 09:25:52 -07:00
parent 0d7115a5a4
commit 4877d52cf4

View File

@ -121,9 +121,9 @@ def assert_no_exception(func):
def assert_warning(warn_class, func):
# note: this assert calls func three times!
import warnings
def warn_error(message, category, **options):
def warn_error(message, category=UserWarning, **options):
raise category(message)
def warn_ignore(message, category, **options):
def warn_ignore(message, category=UserWarning, **options):
pass
warn = warnings.warn
result = None