File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change 25
25
import sqlite3 as sqlite
26
26
import sys
27
27
28
+ from test .support import gc_collect
28
29
from test .support .os_helper import TESTFN , unlink
29
30
30
31
@@ -180,6 +181,8 @@ def __fspath__(self):
180
181
path = Path ()
181
182
with sqlite .connect (path ) as cx :
182
183
cx .execute ('create table test(id integer)' )
184
+ cx .close ()
185
+ gc_collect ()
183
186
184
187
def test_open_uri (self ):
185
188
self .addCleanup (unlink , TESTFN )
@@ -190,6 +193,8 @@ def test_open_uri(self):
190
193
with sqlite .connect ('file:' + TESTFN + '?mode=ro' , uri = True ) as cx :
191
194
with self .assertRaises (sqlite .OperationalError ):
192
195
cx .execute ('insert into test(id) values(1)' )
196
+ cx .close ()
197
+ gc_collect ()
193
198
194
199
195
200
class StatementCacheTests (unittest .TestCase ):
Original file line number Diff line number Diff line change 23
23
import unittest
24
24
import sqlite3 as sqlite
25
25
26
+ from test .support import gc_collect
26
27
from test .support .os_helper import TESTFN , unlink
27
28
28
29
@@ -260,6 +261,9 @@ def trace(statement):
260
261
con2 .execute ("create table bar(x)" )
261
262
cur .execute (queries [1 ])
262
263
self .assertEqual (traced_statements , queries )
264
+ con1 .close ()
265
+ con2 .close ()
266
+ gc_collect ()
263
267
264
268
265
269
def suite ():
You can’t perform that action at this time.
0 commit comments