Skip to content

Commit 0fe2b88

Browse files
committed
Fix ResourceWarning from unclosed SQLite connection in ClosedCurTests.
Follow up to 1a1bfc2.
1 parent 79fdacc commit 0fe2b88

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_sqlite3/test_dbapi.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from test.support.os_helper import TESTFN, TESTFN_UNDECODABLE, unlink, temp_dir, FakePath
4141

4242
from .util import memory_database, cx_limit
43+
from .util import MemoryDatabaseMixin
4344

4445

4546
class ModuleTests(unittest.TestCase):
@@ -1740,10 +1741,9 @@ def test_closed_call(self):
17401741
self.check(self.con)
17411742

17421743

1743-
class ClosedCurTests(unittest.TestCase):
1744+
class ClosedCurTests(MemoryDatabaseMixin, unittest.TestCase):
17441745
def test_closed(self):
1745-
con = sqlite.connect(":memory:")
1746-
cur = con.cursor()
1746+
cur = self.cx.cursor()
17471747
cur.close()
17481748

17491749
for method_name in ("execute", "executemany", "executescript", "fetchall", "fetchmany", "fetchone"):

0 commit comments

Comments
 (0)