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
commented
Feb 14, 2024
•
edited by bedevere-app
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 :)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.
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.
|