mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.10] bpo-43988: Add test.support.check_disallow_instantiation() (GH-25757) (GH-26885)
(cherry picked from commit4f725261c6,fbff5387c3, and8cec740820) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> Automerge-Triggered-By: GH:vstinner
This commit is contained in:
parent
ece3841d3d
commit
0a3452e7cf
16 changed files with 58 additions and 53 deletions
|
|
@ -25,6 +25,7 @@
|
|||
import sqlite3 as sqlite
|
||||
import sys
|
||||
|
||||
from test.support import check_disallow_instantiation
|
||||
from test.support.os_helper import TESTFN, unlink
|
||||
|
||||
|
||||
|
|
@ -94,8 +95,7 @@ def test_shared_cache_deprecated(self):
|
|||
|
||||
def test_disallow_instantiation(self):
|
||||
cx = sqlite.connect(":memory:")
|
||||
tp = type(cx("select 1"))
|
||||
self.assertRaises(TypeError, tp)
|
||||
check_disallow_instantiation(self, type(cx("select 1")))
|
||||
|
||||
|
||||
class ConnectionTests(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue