From: Serhiy Storchaka Date: Sun, 29 Aug 2021 10:07:40 +0000 (+0300) Subject: bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) X-Git-Tag: v3.11.0a1~314 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=07d3d54;p=thirdparty%2FPython%2Fcpython.git bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) --- diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index bb9d5a7ce3e0..aadecad32adb 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -476,6 +476,9 @@ class CursorTests(unittest.TestCase): 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 ddf36e718194..4a422c8d43da 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -126,11 +126,11 @@ class RegressionTests(unittest.TestCase): 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.