Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 029ec91

Browse files
gh-100414: Skip test_dbm_sqlite3 if sqlite3 is unavailable (#115449)
Co-authored-by: Alex Waygood <[email protected]>
1 parent dd5e4d9 commit 029ec91

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_dbm_sqlite3.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import sqlite3
21
import sys
32
import test.support
43
import unittest
@@ -7,8 +6,12 @@
76
from pathlib import Path
87
from test.support import cpython_only, import_helper, os_helper
98

10-
119
dbm_sqlite3 = import_helper.import_module("dbm.sqlite3")
10+
# N.B. The test will fail on some platforms without sqlite3
11+
# if the sqlite3 import is above the import of dbm.sqlite3.
12+
# This is deliberate: if the import helper managed to import dbm.sqlite3,
13+
# we must inevitably be able to import sqlite3. Else, we have a problem.
14+
import sqlite3
1215
from dbm.sqlite3 import _normalize_uri
1316

1417

0 commit comments

Comments
 (0)