bpo-40823: Use loadTestsFromTestCase() iso. makeSuite() in sqlite3 tests (GH-20538)

This commit is contained in:
Erlend Egeberg Aasland 2021-01-07 01:05:07 +01:00 committed by GitHub
parent 1ab045933b
commit 849e339a92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 345 additions and 320 deletions

View file

@ -11,7 +11,7 @@ class DumpTests(unittest.TestCase):
def tearDown(self):
self.cx.close()
def CheckTableDump(self):
def test_table_dump(self):
expected_sqls = [
"""CREATE TABLE "index"("index" blob);"""
,
@ -49,7 +49,7 @@ class DumpTests(unittest.TestCase):
[self.assertEqual(expected_sqls[i], actual_sqls[i])
for i in range(len(expected_sqls))]
def CheckUnorderableRow(self):
def test_unorderable_row(self):
# iterdump() should be able to cope with unorderable row types (issue #15545)
class UnorderableRow:
def __init__(self, cursor, row):
@ -71,7 +71,12 @@ class DumpTests(unittest.TestCase):
self.assertEqual(expected, got)
def suite():
return unittest.TestSuite(unittest.makeSuite(DumpTests, "Check"))
tests = [
DumpTests,
]
return unittest.TestSuite(
[unittest.TestLoader().loadTestsFromTestCase(t) for t in tests]
)
def test():
runner = unittest.TextTestRunner()