]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 29 Aug 2021 10:07:40 +0000 (13:07 +0300)
committerGitHub <noreply@github.com>
Sun, 29 Aug 2021 10:07:40 +0000 (13:07 +0300)
Lib/sqlite3/test/dbapi.py
Lib/sqlite3/test/regression.py

index bb9d5a7ce3e001f26dcd289821ed22f6bdbfe106..aadecad32adb2bc4dd1dfb6143a6a3a39440e014 100644 (file)
@@ -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
index ddf36e718194453907d5177c08bdf9c6715c3d14..4a422c8d43daa0a3681bb599180816f000952984 100644 (file)
@@ -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.