From 7d0a47e1affd0a2f56600f3e9473f55f931595bd Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Sun, 20 Jun 2021 21:24:32 +0200 Subject: bpo-44087: Disallow instantiation of sqlite3.Statement (GH-26567) --- Lib/sqlite3/test/dbapi.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Lib/sqlite3/test/dbapi.py') diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 29242312454..e8bd8c59947 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): -- cgit v1.2.3