8000 bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module by erlend-aasland · Pull Request #24203 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module #24203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jun 3, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests on Windows
  • Loading branch information
Erlend E. Aasland committed May 25, 2021
commit d2078bced6179882fe911be091b467e506a0db56
5 changes: 5 additions & 0 deletions Lib/sqlite3/test/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import sqlite3 as sqlite
import sys

from test.support import gc_collect
from test.support.os_helper import TESTFN, unlink


Expand Down Expand Up @@ -180,6 +181,8 @@ def __fspath__(self):
path = Path()
with sqlite.connect(path) as cx:
cx.execute('create table test(id integer)')
cx.close()
gc_collect()

def test_open_uri(self):
self.addCleanup(unlink, TESTFN)
Expand All @@ -190,6 +193,8 @@ def test_open_uri(self):
with sqlite.connect('file:' + TESTFN + '?mode=ro', uri=True) as cx:
with self.assertRaises(sqlite.OperationalError):
cx.execute('insert into test(id) values(1)')
cx.close()
gc_collect()


class StatementCacheTests(unittest.TestCase):
Expand Down
4 changes: 4 additions & 0 deletions Lib/sqlite3/test/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import unittest
import sqlite3 as sqlite

from test.support import gc_collect
from test.support.os_helper import TESTFN, unlink


Expand Down Expand Up @@ -260,6 +261,9 @@ def trace(statement):
con2.execute("create table bar(x)")
cur.execute(queries[1])
self.assertEqual(traced_statements, queries)
con1.close()
con2.close()
gc_collect()


def suite():
Expand Down
0