summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-09 10:50:41 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-09 10:50:41 (GMT)
commit502ff6c920505e95ccfa9f93adc0b534ad76c6b3 (patch)
tree4adabaa116584391ce484568db44ae04b389ea0f
parent8f9f8d612a1ee264a465f493b1ce6215418128de (diff)
downloadcpython-502ff6c920505e95ccfa9f93adc0b534ad76c6b3.zip
cpython-502ff6c920505e95ccfa9f93adc0b534ad76c6b3.tar.gz
cpython-502ff6c920505e95ccfa9f93adc0b534ad76c6b3.tar.bz2
Issue #10811: Use TestCase.assertRaises() in the new test
-rw-r--r--Lib/sqlite3/test/regression.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index f80b269..c7551e3 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -298,11 +298,10 @@ class RegressionTests(unittest.TestCase):
cur.execute("insert into a (bar) values (?)", (1,))
yield 1
- try:
- cur.executemany("insert into b (baz) values (?)", ((i,) for i in foo()))
- self.fail("should have raised ProgrammingError")
- except sqlite.ProgrammingError:
- pass
+ with self.assertRaises(sqlite.ProgrammingError):
+ cur.executemany("insert into b (baz) values (?)",
+ ((i,) for i in foo()))
+
def suite():
regression_suite = unittest.makeSuite(RegressionTests, "Check")