GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve `test_sqlite3.test_sqlite_row_iter` · Issue #100553 · python/cpython

Improve test_sqlite3.test_sqlite_row_iter #100553

New issue
Copy link
New issue
Copy link
Closed
Closed
Improve test_sqlite3.test_sqlite_row_iter#100553
Copy link
Assignees
sobolevn
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-sqlite3type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on Dec 27, 2022
Issue body actions

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

  • gh-100553: Improve accuracy of sqlite3.Row iter test #100555
  • [3.11] gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555) #100564
  • [3.10] gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555) #100565

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-sqlite3
    on Dec 27, 2022
  2. sobolevn
    self-assigned this
    on Dec 27, 2022
  3. sobolevn
    changed the title [-]Improve `test_[/-] [+]Improve `test_sqlite3.test_sqlite_row_iter`[/+] on Dec 27, 2022
  4. sobolevn
    added 2 commits that reference this issue on Dec 27, 2022

    pythongh-100553: Improve `test_sqlite3.test_sqlite_row_iter`

    5c9d319

    pythongh-100553: Improve `test_sqlite3.test_sqlite_row_iter`

    07376bf
  5. pochmann commented on Dec 27, 2022

    @pochmann
    pochmann
    on Dec 27, 2022
    Contributor
    More actions

    Also, col and items are misleading names, better use value and values (that's what the Row documentation calls them).

  6. erlend-aasland
    added a commit that references this issue on Dec 28, 2022

    gh-100553: Improve accuracy of sqlite3.Row iter test (#100555)

    3dc48da
  7. miss-islington
    added 2 commits that reference this issue on Dec 28, 2022

    pythongh-100553: Improve accuracy of sqlite3.Row iter test (pythonGH-…

    e57aca4

    pythongh-100553: Improve accuracy of sqlite3.Row iter test (pythonGH-…

    fbdb389
  8. erlend-aasland commented on Dec 28, 2022

    @erlend-aasland
    erlend-aasland
    on Dec 28, 2022
    Contributor
    More actions

    Thanks, Nikita, good catch!

  9. erlend-aasland
    closed this as completedon Dec 28, 2022
  10. miss-islington
    added 2 commits that reference this issue on Dec 28, 2022

    gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555)

    0428550

    gh-100553: Improve accuracy of sqlite3.Row iter test (GH-100555)

    fba8c7c
  11. iritkatriel
    added a commit that references this issue on Dec 28, 2022

    Merged main into regmachine branch (#50)

    fdc73cb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sobolevn
    sobolevn

Labels

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.