Skip to content

Commit 866e226

Browse files
author
Erlend E. Aasland
committed
Use test.support.gc_collect iso. gc.collect
1 parent 5ff1a80 commit 866e226

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/sqlite3/test/dbapi.py

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

28+
from test.support import gc_collect
2829
from test.support.os_helper import TESTFN, unlink
2930

3031

@@ -174,8 +175,7 @@ def test_in_transaction_ro(self):
174175
class OpenTests(unittest.TestCase):
175176
def tearDown(self):
176177
# bpo-42213: ensure that TESTFN is closed before unlinking
177-
import gc
178-
gc.collect()
178+
gc_collect()
179179
unlink(TESTFN)
180180

181181
def test_open_with_path_like_object(self):

Lib/sqlite3/test/hooks.py

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

26+
from test.support import gc_collect
2627
from test.support.os_helper import TESTFN, unlink
2728

2829

@@ -264,8 +265,7 @@ def trace(statement):
264265
# bpo-42213: ensure that TESTFN is closed before the cleanup runs
265266
con1.close()
266267
con2.close()
267-
import gc
268-
gc.collect()
268+
gc_collect()
269269

270270

271271
def suite():

0 commit comments

Comments
 (0)