Use assert_true instead of assert_

assert_ is deprecated which causes annoying warnings
This commit is contained in:
Daniel Neuhäuser 2013-05-22 17:23:38 +02:00
parent 5b89355b1c
commit 239780be28
12 changed files with 147 additions and 144 deletions

View file

@ -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):