8000 Address review: document Windows test workaround · python/cpython@8d1c138 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d1c138

Browse files
author
Erlend E. Aasland
committed
Address review: document Windows test workaround
1 parent 839f264 commit 8d1c138

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Lib/sqlite3/test/dbapi.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ def __fspath__(self):
181181
path = Path()
182182
with sqlite.connect(path) as cx:
183183
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.
184187
cx.close()
185188
gc_collect()
186189

@@ -193,6 +196,9 @@ def test_open_uri(self):
193196
with sqlite.connect('file:' + TESTFN + '?mode=ro', uri=True) as cx:
194197
with self.assertRaises(sqlite.OperationalError):
195198
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.
196202
cx.close()
197203
gc_collect()
198204

Lib/sqlite3/test/hooks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ def trace(statement):
261261
con2.execute("create table bar(x)")
262262
cur.execute(queries[1])
263263
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.
264267
con1.close()
265268
con2.close()
266269
gc_collect()

0 commit comments

Comments
 (0)
0