mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-100553: Improve accuracy of sqlite3.Row iter test (#100555)
This commit is contained in:
parent
b0ea28913e
commit
3dc48dabd4
1 changed files with 8 additions and 2 deletions
|
@ -179,8 +179,14 @@ class RowFactoryTests(unittest.TestCase):
|
|||
"""Checks if the row object is iterable"""
|
||||
self.con.row_factory = sqlite.Row
|
||||
row = self.con.execute("select 1 as a, 2 as b").fetchone()
|
||||
for col in row:
|
||||
pass
|
||||
|
||||
# Is iterable in correct order and produces valid results:
|
||||
items = [col for col in row]
|
||||
self.assertEqual(items, [1, 2])
|
||||
|
||||
# Is iterable the second time:
|
||||
items = [col for col in row]
|
||||
self.assertEqual(items, [1, 2])
|
||||
|
||||
def test_sqlite_row_as_tuple(self):
|
||||
"""Checks if the row object can be converted to a tuple"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue