diff options
author | Larry Hastings <larry@hastings.org> | 2016-06-12 20:26:28 -0700 |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2016-06-12 20:26:28 -0700 |
commit | 29f963732166260420ffbdebe9eb8b98a009dc8c (patch) | |
tree | 17ad6530ee3b66b53647ab70bac08145dcd69783 /Lib/sqlite3/test/regression.py | |
parent | 6e9a96be9e24265638df8aa600e566b306a23a2b (diff) | |
parent | 1003b34c71d53ccb88ae2768aaba503ae6b5bc16 (diff) | |
download | cpython-git-29f963732166260420ffbdebe9eb8b98a009dc8c.tar.gz |
Merge 3.5.2rc1 with current 3.5 branch.
Diffstat (limited to 'Lib/sqlite3/test/regression.py')
-rw-r--r-- | Lib/sqlite3/test/regression.py | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py index 11adb300d8..85ace84d75 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -170,14 +170,8 @@ class RegressionTests(unittest.TestCase): con = sqlite.connect(":memory:") cur = Cursor(con) - try: + with self.assertRaises(sqlite.ProgrammingError): cur.execute("select 4+5").fetchall() - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("should have raised ProgrammingError") - def CheckStrSubclass(self): """ @@ -196,13 +190,8 @@ class RegressionTests(unittest.TestCase): pass con = Connection(":memory:") - try: + with self.assertRaises(sqlite.ProgrammingError): cur = con.cursor() - self.fail("should have raised ProgrammingError") - except sqlite.ProgrammingError: - pass - except: - self.fail("should have raised ProgrammingError") def CheckCursorRegistration(self): """ @@ -223,13 +212,8 @@ class RegressionTests(unittest.TestCase): cur.executemany("insert into foo(x) values (?)", [(3,), (4,), (5,)]) cur.execute("select x from foo") con.rollback() - try: + with self.assertRaises(sqlite.InterfaceError): cur.fetchall() - self.fail("should have raised InterfaceError") - except sqlite.InterfaceError: - pass - except: - self.fail("should have raised InterfaceError") def CheckAutoCommit(self): """ |