summaryrefslogtreecommitdiff
path: root/Lib/sqlite3
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-06-12 14:09:51 +0300
committerBerker Peksag <berker.peksag@gmail.com>2016-06-12 14:09:51 +0300
commit7bea2347c7e8af2c6b59e541c4039c34c7a8f6b2 (patch)
tree43b082adfa798c7ba87552edbdca905bd8f8c3a2 /Lib/sqlite3
parentc415440faa67c488fd2a5d8fc0977cbd660c4a90 (diff)
downloadcpython-git-7bea2347c7e8af2c6b59e541c4039c34c7a8f6b2.tar.gz
Issue #27190: Raise NotSupportedError if sqlite3 is older than 3.3.1
Patch by Dave Sawyer.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r--Lib/sqlite3/test/dbapi.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 04d04794c7..78c27d7a71 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -180,6 +180,12 @@ class ConnectionTests(unittest.TestCase):
with self.assertRaises(sqlite.OperationalError):
cx.execute('insert into test(id) values(1)')
+ def CheckSameThreadErrorOnOldVersion(self):
+ if sqlite.sqlite_version_info >= (3, 3, 1):
+ self.skipTest('test needs sqlite3 versions older than 3.3.1')
+ with self.assertRaises(sqlite.NotSupportedError) as cm:
+ sqlite.connect(':memory:', check_same_thread=False)
+ self.assertEqual(str(cm.exception), 'shared connections not available')
class CursorTests(unittest.TestCase):
def setUp(self):