diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-06-20 19:24:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 19:24:32 (GMT) |
commit | 7d0a47e1affd0a2f56600f3e9473f55f931595bd (patch) | |
tree | aefae63f26d45e09a212582508bed27a8662d2db /Lib/sqlite3 | |
parent | 185ecdc1463c527743eeb16a5deef75c1985de79 (diff) | |
download | cpython-7d0a47e1affd0a2f56600f3e9473f55f931595bd.zip cpython-7d0a47e1affd0a2f56600f3e9473f55f931595bd.tar.gz cpython-7d0a47e1affd0a2f56600f3e9473f55f931595bd.tar.bz2 |
bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567)
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 2924231..e8bd8c5 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -26,6 +26,7 @@ import sys import threading import unittest +from test.support import check_disallow_instantiation from test.support.os_helper import TESTFN, unlink from test.support import threading_helper @@ -105,6 +106,10 @@ class ModuleTests(unittest.TestCase): sqlite.enable_shared_cache(enable) self.assertIn("dbapi.py", cm.filename) + def test_disallow_instantiation(self): + cx = sqlite.connect(":memory:") + check_disallow_instantiation(self, type(cx("select 1"))) + class ConnectionTests(unittest.TestCase): |