File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,9 @@ def __fspath__(self):
181
181
path = Path ()
182
182
with sqlite .connect (path ) as cx :
183
183
cx .execute ('create table test(id integer)' )
184
+
185
+ # bpo-42862: addCleanup fails to unlink TESTFN on Windows unless we
186
+ # explicitly close the connection and run the GC.
184
187
cx .close ()
185
188
gc_collect ()
186
189
@@ -193,6 +196,9 @@ def test_open_uri(self):
193
196
with sqlite .connect ('file:' + TESTFN + '?mode=ro' , uri = True ) as cx :
194
197
with self .assertRaises (sqlite .OperationalError ):
195
198
cx .execute ('insert into test(id) values(1)' )
199
+
200
+ # bpo-42862: addCleanup fails to unlink TESTFN on Windows unless we
201
+ # explicitly close the connection and run the GC.
196
202
cx .close ()
197
203
gc_collect ()
198
204
Original file line number Diff line number Diff line change @@ -261,6 +261,9 @@ def trace(statement):
261
261
con2 .execute ("create table bar(x)" )
262
262
cur .execute (queries [1 ])
263
263
self .assertEqual (traced_statements , queries )
264
+
265
+ # bpo-42862: addCleanup fails to unlink TESTFN on Windows unless we
266
+ # explicitly close the connections and run the GC.
264
267
con1 .close ()
265
268
con2 .close ()
266
269
gc_collect ()
You can’t perform that action at this time.
0 commit comments