diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-08-29 11:03:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 11:03:11 (GMT) |
commit | dab74d68e3f8391cb4b404b397ab80e2e0188d1f (patch) | |
tree | d117af55cc19a069d226c68b7f7c540d95d7ae09 /Lib | |
parent | 1046cd06b0e2f20b3be93de83d49b684956af98d (diff) | |
download | cpython-dab74d68e3f8391cb4b404b397ab80e2e0188d1f.zip cpython-dab74d68e3f8391cb4b404b397ab80e2e0188d1f.tar.gz cpython-dab74d68e3f8391cb4b404b397ab80e2e0188d1f.tar.bz2 |
[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)
(cherry picked from commit 07d3d54)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/sqlite3/test/backup.py | 3 | ||||
-rw-r--r-- | Lib/sqlite3/test/dbapi.py | 3 | ||||
-rw-r--r-- | Lib/sqlite3/test/regression.py | 4 |
3 files changed, 7 insertions, 3 deletions
diff --git a/Lib/sqlite3/test/backup.py b/Lib/sqlite3/test/backup.py index ad1da97..6a772c6 100644 --- a/Lib/sqlite3/test/backup.py +++ b/Lib/sqlite3/test/backup.py @@ -150,7 +150,8 @@ class BackupTests(unittest.TestCase): self.cx.backup(bck, name='non-existing') self.assertIn( str(cm.exception), - ['SQL logic error', 'SQL logic error or missing database'] + ['SQL logic error', 'SQL logic error or missing database', + 'unknown database non-existing'] ) self.cx.execute("ATTACH DATABASE ':memory:' AS attached_db") diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py index 38e9fbd..d00b60c 100644 --- a/Lib/sqlite3/test/dbapi.py +++ b/Lib/sqlite3/test/dbapi.py @@ -395,6 +395,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 6aa86d5..6ba3356 100644 --- a/Lib/sqlite3/test/regression.py +++ b/Lib/sqlite3/test/regression.py @@ -127,11 +127,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 CheckBindMutatingList(self): # Issue41662: Crash when mutate a list of parameters during iteration. |