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 — gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable by erlend-aasland · Pull Request #115448 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Feb 14, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Add sqlite3 as another possible backing store for the dbm module #100414

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@erlend-aasland
pythongh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable
77a2a2e
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner February 14, 2024 11:31
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 14, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Feb 14, 2024
Add sqlite3 as another possible backing store for the dbm module #100414
Closed
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Feb 14, 2024
@erlend-aasland erlend-aasland mentioned this pull request Feb 14, 2024
gh-100414: Add SQLite backend to dbm #114481
Merged
@erlend-aasland

This comment was marked as outdated.

Sign in to view
@bedevere-bot

This comment was marked as outdated.

Sign in to view
@erlend-aasland erlend-aasland added the skip news label Feb 14, 2024
@erlend-aasland

This comment was marked as outdated.

Sign in to view
@bedevere-bot

This comment was marked as outdated.

Sign in to view
AlexWaygood
AlexWaygood approved these changes Feb 14, 2024
View reviewed changes

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming it fixes the buildbots

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Feb 14, 2024
@erlend-aasland

erlend-aasland commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

LGTM, assuming it fixes the buildbots

We can also do this:

diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py
index 0eda8da4ab..7136b54016 100644
--- a/Lib/test/test_dbm_sqlite3.py
+++ b/Lib/test/test_dbm_sqlite3.py
@@ -6,9 +6,8 @@
 from pathlib import Path
 from test.support import cpython_only, import_helper, os_helper
 
-
-sqlite3 = import_helper.import_module("sqlite3")
 dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
+import sqlite3
 from dbm.sqlite3 import _normalize_uri
 
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Feb 14, 2024
gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable #115449
Merged
@AlexWaygood

AlexWaygood commented Feb 14, 2024

Copy link
Copy Markdown
Member

LGTM, assuming it fixes the buildbots

We can also do this:

diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py
index 0eda8da4ab..7136b54016 100644
--- a/Lib/test/test_dbm_sqlite3.py
+++ b/Lib/test/test_dbm_sqlite3.py
@@ -6,9 +6,8 @@
 from pathlib import Path
 from test.support import cpython_only, import_helper, os_helper
 
-
-sqlite3 = import_helper.import_module("sqlite3")
 dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
+import sqlite3
 from dbm.sqlite3 import _normalize_uri
 

Not much difference between the two :)

The advantage of #115449 is that the test will fail if dbm.sqlite3 is available but sqlite3 is unavailable. That would be pretty weird, but also seems very unlikely to actually happen. The advantage of this PR is that the test will continue to pass no matter which order the imports are in, which is more robust against the test file potentially being refactored in the future.

As I say, very marginal, but I'd probably go for this one!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

The advantage of #115449 is that the test will fail if dbm.sqlite3 is available but sqlite3 is unavailable.

Well, that should never be allowed to happen, which is why I prefer that PR :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland

erlend-aasland commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

Closed in favour of #115449.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland closed this Feb 14, 2024
@erlend-aasland
erlend-aasland deleted the dbm/fix-sqlite3-backend branch February 14, 2024 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

awaiting merge skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@erlend-aasland @bedevere-bot @AlexWaygood
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.