diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-02-14 13:16:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-14 13:16:09 (GMT) |
commit | 029ec91d43b377535ff7eb94993e0d2add4af720 (patch) | |
tree | 282ada290c0e51a04bac68064cd0f9cdcc57353a | |
parent | dd5e4d90789b3a065290e264122629f31cb0b547 (diff) | |
download | cpython-029ec91d43b377535ff7eb94993e0d2add4af720.zip cpython-029ec91d43b377535ff7eb94993e0d2add4af720.tar.gz cpython-029ec91d43b377535ff7eb94993e0d2add4af720.tar.bz2 |
gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
-rw-r--r-- | Lib/test/test_dbm_sqlite3.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_dbm_sqlite3.py b/Lib/test/test_dbm_sqlite3.py index 7bc2a03..7a49fd2 100644 --- a/Lib/test/test_dbm_sqlite3.py +++ b/Lib/test/test_dbm_sqlite3.py @@ -1,4 +1,3 @@ -import sqlite3 import sys import test.support import unittest @@ -7,8 +6,12 @@ from functools import partial from pathlib import Path from test.support import cpython_only, import_helper, os_helper - dbm_sqlite3 = import_helper.import_module("dbm.sqlite3") +# N.B. The test will fail on some platforms without sqlite3 +# if the sqlite3 import is above the import of dbm.sqlite3. +# This is deliberate: if the import helper managed to import dbm.sqlite3, +# we must inevitably be able to import sqlite3. Else, we have a problem. +import sqlite3 from dbm.sqlite3 import _normalize_uri |