Skip to content

Improve test_sqlite3.test_sqlite_row_iter #100553

Closed
@sobolevn

Description

@sobolevn

While working on #100457 I've noticed that test_sqlite_row_iter can be improved. Right now it is defined as:

    def test_sqlite_row_iter(self):
        """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

Well, there are several issues:

  1. We do not check what values it actually returns
  2. We do not check whether or not it is iterable the second time, because some types are implemented as generators and cannot be iterated over the second time

I will send a PR with the improved test.

Linked PRs

Metadata

Metadata

Assignees

Labels

testsTests in the Lib/test dirtopic-sqlite3type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions