Replace more boilerplate code with modern unittest features in sqlite3 tests

This commit is contained in:
Berker Peksag 2016-06-14 00:42:50 +03:00
parent f5b1af6df5
commit 48b5c98e6e
3 changed files with 6 additions and 13 deletions

View file

@ -61,8 +61,8 @@ class CollationTests(unittest.TestCase):
) order by x collate mycoll
"""
result = con.execute(sql).fetchall()
if result[0][0] != "c" or result[1][0] != "b" or result[2][0] != "a":
self.fail("the expected order was not returned")
self.assertEqual(result, [('c',), ('b',), ('a',)],
msg='the expected order was not returned')
con.create_collation("mycoll", None)
with self.assertRaises(sqlite.OperationalError) as cm: