Commit e24c8f85 authored by Victor Stinner's avatar Victor Stinner

Issue #10811: Use TestCase.assertRaises() in the new test

parent a2830589
...@@ -298,11 +298,10 @@ class RegressionTests(unittest.TestCase): ...@@ -298,11 +298,10 @@ class RegressionTests(unittest.TestCase):
cur.execute("insert into a (bar) values (?)", (1,)) cur.execute("insert into a (bar) values (?)", (1,))
yield 1 yield 1
try: with self.assertRaises(sqlite.ProgrammingError):
cur.executemany("insert into b (baz) values (?)", ((i,) for i in foo())) cur.executemany("insert into b (baz) values (?)",
self.fail("should have raised ProgrammingError") ((i,) for i in foo()))
except sqlite.ProgrammingError:
pass
def suite(): def suite():
regression_suite = unittest.makeSuite(RegressionTests, "Check") regression_suite = unittest.makeSuite(RegressionTests, "Check")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment