Issue #27190: Raise NotSupportedError if sqlite3 is older than 3.3.1
Patch by Dave Sawyer.
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 04d0479..78c27d7 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -180,6 +180,12 @@
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):