diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-08-29 10:07:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 10:07:40 (GMT) |
commit | 07d3d54f4e84b1259b800884b202701f69e408d8 (patch) | |
tree | f4c67cb394212c5a3b38912904b684af3ce05f4b /Lib | |
parent | eb263f9a356f5c5f21b8d5ce20bac92f31c40cad (diff) | |
download | cpython-07d3d54f4e84b1259b800884b202701f69e408d8.zip cpython-07d3d54f4e84b1259b800884b202701f69e408d8.tar.gz cpython-07d3d54f4e84b1259b800884b202701f69e408d8.tar.bz2 |
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 3 | ||||
-rw-r--r-- | Lib/sqlite3/test/regression.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index bb9d5a7..aadecad 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 ddf36e7..4a422c8 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. |