forked from orbit-oss/flask
Use assert_true instead of assert_
assert_ is deprecated which causes annoying warnings
This commit is contained in:
parent
5b89355b1c
commit
239780be28
12 changed files with 147 additions and 144 deletions
|
|
@ -101,9 +101,9 @@ def emits_module_deprecation_warning(f):
|
|||
def new_f(self, *args, **kwargs):
|
||||
with catch_warnings() as log:
|
||||
f(self, *args, **kwargs)
|
||||
self.assert_(log, 'expected deprecation warning')
|
||||
self.assert_true(log, 'expected deprecation warning')
|
||||
for entry in log:
|
||||
self.assert_('Modules are deprecated' in str(entry['message']))
|
||||
self.assert_true('Modules are deprecated' in str(entry['message']))
|
||||
return update_wrapper(new_f, f)
|
||||
|
||||
|
||||
|
|
@ -142,6 +142,9 @@ class FlaskTestCase(unittest.TestCase):
|
|||
with catcher:
|
||||
callable(*args, **kwargs)
|
||||
|
||||
def assert_true(self, x):
|
||||
self.assertTrue(x)
|
||||
|
||||
|
||||
class _ExceptionCatcher(object):
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue