[Python-checkins] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
serhiy-storchaka
webhook-mailer at python.org
Sun Aug 29 06:08:11 EDT 2021
https://github.com/python/cpython/commit/07d3d54f4e84b1259b800884b202701f69e408d8
commit: 07d3d54f4e84b1259b800884b202701f69e408d8
branch: main
author: Serhiy Storchaka <storchaka at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-08-29T13:07:40+03:00
summary:
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
files:
M Lib/sqlite3/test/dbapi.py
M Lib/sqlite3/test/regression.py
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index bb9d5a7ce3e001..aadecad32adb2b 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -476,6 +476,9 @@ class MyIter:
def __init__(self):
self.value = 5
+ def __iter__(self):
+ return self
+
def __next__(self):
if self.value == 10:
raise StopIteration
diff --git a/Lib/sqlite3/test/regression.py b/Lib/sqlite3/test/regression.py
index ddf36e71819445..4a422c8d43daa0 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -126,11 +126,11 @@ def test_type_map_usage(self):
con = sqlite.connect(":memory:",detect_types=sqlite.PARSE_DECLTYPES)
con.execute("create table foo(bar timestamp)")
con.execute("insert into foo(bar) values (?)", (datetime.datetime.now(),))
- con.execute(SELECT)
+ con.execute(SELECT).close()
con.execute("drop table foo")
con.execute("create table foo(bar integer)")
con.execute("insert into foo(bar) values (5)")
- con.execute(SELECT)
+ con.execute(SELECT).close()
def test_bind_mutating_list(self):
# Issue41662: Crash when mutate a list of parameters during iteration.
More information about the Python-checkins
mailing list