Use assertGreater(len(x), y) instead of assertTrue(len(x) > y)

assertGreater provides a nicer error message if it fails.

Change-Id: I127beaf68a6e92ad4e0f65eea5a608bc7e50cb09
This commit is contained in:
pangliye 2016-12-16 15:43:46 +08:00 committed by Steve Martinelli
parent 3e5ead0a45
commit 2dfd163c69
1 changed files with 1 additions and 1 deletions

View File

@ -820,7 +820,7 @@ class TestCase(BaseTestCase):
"%s != %s" % (expected, value))
def assertNotEmpty(self, l):
self.assertTrue(len(l))
self.assertGreater(len(l), 0)
def assertRaisesRegexp(self, expected_exception, expected_regexp,
callable_obj, *args, **kwargs):