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 — Use TESTFN iso. hard-coded test file paths in sqlite3 tests · Issue #93795 · python/cpython

Use TESTFN iso. hard-coded test file paths in sqlite3 tests #93795

New issue
Copy link
New issue
Copy link
Closed
#93796
Closed
Use TESTFN iso. hard-coded test file paths in sqlite3 tests#93795
#93796
Copy link
Assignees
erlend-aasland
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

@erlend-aasland
erlend-aasland
opened on Jun 14, 2022
Issue body actions

Current code:

cpython/Lib/test/test_sqlite3/test_transactions.py

Lines 28 to 54 in 5bcf33d

def get_db_path():
return "sqlite_testdb"
class TransactionTests(unittest.TestCase):
def setUp(self):
try:
os.remove(get_db_path())
except OSError:
pass
self.con1 = sqlite.connect(get_db_path(), timeout=0.1)
self.cur1 = self.con1.cursor()
self.con2 = sqlite.connect(get_db_path(), timeout=0.1)
self.cur2 = self.con2.cursor()
def tearDown(self):
self.cur1.close()
self.con1.close()
self.cur2.close()
self.con2.close()
try:
os.unlink(get_db_path())
except OSError:
pass

Suggesting to use the test.support helpers TESTFN and unlink.

Activity

  1. erlend-aasland
    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 Jun 14, 2022
  2. erlend-aasland
    self-assigned this
    on Jun 14, 2022
  3. erlend-aasland
    added this to sqlite3 issueson Jun 14, 2022
  4. erlend-aasland
    moved this to In Progress in sqlite3 issueson Jun 14, 2022
  5. erlend-aasland commented on Jun 14, 2022

    @erlend-aasland
    erlend-aasland
    on Jun 14, 2022
    ContributorAuthor
    More actions

    We can also swap the timeout with one of the timeout constants in test.support.

  6. erlend-aasland
    added a commit that references this issue on Jun 14, 2022

    pythongh-93795: Use test.support TESTFN/unlink in sqlite3 tests

    48873b1
  7. erlend-aasland
    linked a pull request that will close this issuegh-93795: Use test.support TESTFN/unlink in sqlite3 tests #93796on Jun 14, 2022
  8. erlend-aasland
    closed this as completedin #93796on Jun 14, 2022
  9. Repository owner moved this from In Progress to Done in sqlite3 issueson Jun 14, 2022
  10. erlend-aasland
    added 5 commits that reference this issue on Jun 14, 2022

    gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (#93796)

    d773c6e

    [3.11] pythongh-93795: Use test.support TESTFN/unlink in sqlite3 tests (

    0d9b1c1

    [3.10] pythongh-93795: Use test.support TESTFN/unlink in sqlite3 tests (

    de0bc5a

    [3.11] gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (GH-…

    7aa4038

    [3.10] gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (GH-…

    8b36ce6
  11. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

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

Metadata

Metadata

Assignees

  • @erlend-aasland
    erlend-aasland

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

  • sqlite3 issues
    Status
    Done
    Show more project fields

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.