[Python-checkins] [3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)

serhiy-storchaka webhook-mailer at python.org
Sun Aug 29 07:03:15 EDT 2021


https://github.com/python/cpython/commit/dab74d68e3f8391cb4b404b397ab80e2e0188d1f
commit: dab74d68e3f8391cb4b404b397ab80e2e0188d1f
branch: 3.9
author: Serhiy Storchaka <storchaka at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-08-29T14:03:11+03:00
summary:

[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)

(cherry picked from commit 07d3d54)

files:
M Lib/sqlite3/test/backup.py
M Lib/sqlite3/test/dbapi.py
M Lib/sqlite3/test/regression.py

diff --git a/Lib/sqlite3/test/backup.py b/Lib/sqlite3/test/backup.py
index ad1da9721527c2..6a772c64b2dfbc 100644
--- a/Lib/sqlite3/test/backup.py
+++ b/Lib/sqlite3/test/backup.py
@@ -150,7 +150,8 @@ def test_database_source_name(self):
                 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 38e9fbd9d1dd60..d00b60cac4e389 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -395,6 +395,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 6aa86d5766e568..6ba33564795536 100644
--- a/Lib/sqlite3/test/regression.py
+++ b/Lib/sqlite3/test/regression.py
@@ -127,11 +127,11 @@ def CheckTypeMapUsage(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 CheckBindMutatingList(self):
         # Issue41662: Crash when mutate a list of parameters during iteration.



More information about the Python-checkins mailing list