Skip to content

Commit 063878c

Browse files
author
Erlend E. Aasland
committed
Revert gc workarounds
Reverts commits: - 866e226. - 5ff1a80. - 1e3f589. - 6cb435b.
1 parent 866e226 commit 063878c

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

Lib/sqlite3/test/dbapi.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import sqlite3 as sqlite
2626
import sys
2727

28-
from test.support import gc_collect
2928
from test.support.os_helper import TESTFN, unlink
3029

3130

@@ -171,16 +170,10 @@ def test_in_transaction_ro(self):
171170
with self.assertRaises(AttributeError):
172171
self.cx.in_transaction = True
173172

174-
175-
class OpenTests(unittest.TestCase):
176-
def tearDown(self):
177-
# bpo-42213: ensure that TESTFN is closed before unlinking
178-
gc_collect()
179-
unlink(TESTFN)
180-
181173
def test_open_with_path_like_object(self):
182174
""" Checks that we can successfully connect to a database using an object that
183175
is PathLike, i.e. has __fspath__(). """
176+
self.addCleanup(unlink, TESTFN)
184177
class Path:
185178
def __fspath__(self):
186179
return TESTFN
@@ -189,6 +182,7 @@ def __fspath__(self):
189182
cx.execute('create table test(id integer)')
190183

191184
def test_open_uri(self):
185+
self.addCleanup(unlink, TESTFN)
192186
with sqlite.connect(TESTFN) as cx:
193187
cx.execute('create table test(id integer)')
194188
with sqlite.connect('file:' + TESTFN, uri=True) as cx:
@@ -948,7 +942,6 @@ def suite():
948942
CursorTests,
949943
ExtensionTests,
950944
ModuleTests,
951-
OpenTests,
952945
SqliteOnConflictTests,
953946
ThreadTests,
954947
]

Lib/sqlite3/test/hooks.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import unittest
2424
import sqlite3 as sqlite
2525

26-
from test.support import gc_collect
2726
from test.support.os_helper import TESTFN, unlink
2827

2928

@@ -262,11 +261,6 @@ def trace(statement):
262261
cur.execute(queries[1])
263262
self.assertEqual(traced_statements, queries)
264263

265-
# bpo-42213: ensure that TESTFN is closed before the cleanup runs
266-
con1.close()
267-
con2.close()
268-
gc_collect()
269-
270264

271265
def suite():
272266
tests = [

0 commit comments

Comments
 (0)