mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
[3.9] bpo-25130: Make SQLite tests more compatible with PyPy (GH-28021) (GH-28023)
(cherry picked from commit 07d3d54
)
This commit is contained in:
parent
1046cd06b0
commit
dab74d68e3
3 changed files with 7 additions and 3 deletions
|
@ -150,7 +150,8 @@ class BackupTests(unittest.TestCase):
|
||||||
self.cx.backup(bck, name='non-existing')
|
self.cx.backup(bck, name='non-existing')
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
str(cm.exception),
|
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")
|
self.cx.execute("ATTACH DATABASE ':memory:' AS attached_db")
|
||||||
|
|
|
@ -395,6 +395,9 @@ class CursorTests(unittest.TestCase):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.value = 5
|
self.value = 5
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return self
|
||||||
|
|
||||||
def __next__(self):
|
def __next__(self):
|
||||||
if self.value == 10:
|
if self.value == 10:
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
|
|
|
@ -127,11 +127,11 @@ class RegressionTests(unittest.TestCase):
|
||||||
con = sqlite.connect(":memory:",detect_types=sqlite.PARSE_DECLTYPES)
|
con = sqlite.connect(":memory:",detect_types=sqlite.PARSE_DECLTYPES)
|
||||||
con.execute("create table foo(bar timestamp)")
|
con.execute("create table foo(bar timestamp)")
|
||||||
con.execute("insert into foo(bar) values (?)", (datetime.datetime.now(),))
|
con.execute("insert into foo(bar) values (?)", (datetime.datetime.now(),))
|
||||||
con.execute(SELECT)
|
con.execute(SELECT).close()
|
||||||
con.execute("drop table foo")
|
con.execute("drop table foo")
|
||||||
con.execute("create table foo(bar integer)")
|
con.execute("create table foo(bar integer)")
|
||||||
con.execute("insert into foo(bar) values (5)")
|
con.execute("insert into foo(bar) values (5)")
|
||||||
con.execute(SELECT)
|
con.execute(SELECT).close()
|
||||||
|
|
||||||
def CheckBindMutatingList(self):
|
def CheckBindMutatingList(self):
|
||||||
# Issue41662: Crash when mutate a list of parameters during iteration.
|
# Issue41662: Crash when mutate a list of parameters during iteration.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue