mirror of
https://github.com/python/cpython.git
synced 2025-09-20 07:31:10 +00:00
bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)
The sqlite3 module now fully implements the GC protocol, so there's no need for this workaround anymore. - Add and use managed resource helper for connections using TESTFN - Sort test imports - Split open-tests into their own test case Automerge-Triggered-By: GH:vstinner
This commit is contained in:
parent
2c1e2583fd
commit
d88b47b5a3
5 changed files with 37 additions and 39 deletions
|
@ -254,11 +254,15 @@ class TraceCallbackTests(unittest.TestCase):
|
|||
self.addCleanup(unlink, TESTFN)
|
||||
con1 = sqlite.connect(TESTFN, isolation_level=None)
|
||||
con2 = sqlite.connect(TESTFN)
|
||||
con1.set_trace_callback(trace)
|
||||
cur = con1.cursor()
|
||||
cur.execute(queries[0])
|
||||
con2.execute("create table bar(x)")
|
||||
cur.execute(queries[1])
|
||||
try:
|
||||
con1.set_trace_callback(trace)
|
||||
cur = con1.cursor()
|
||||
cur.execute(queries[0])
|
||||
con2.execute("create table bar(x)")
|
||||
cur.execute(queries[1])
|
||||
finally:
|
||||
con1.close()
|
||||
con2.close()
|
||||
self.assertEqual(traced_statements, queries)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue