Skip to content

Commit 152eb90

Browse files
gh-95291: Use import helper to improve sqlite3 audit tests (#95292)
Now the tests are correctly reported as skipped if sqlite3 is not available.
1 parent b8c5286 commit 152eb90

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/test/test_audit.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ def test_http(self):
155155

156156

157157
def test_sqlite3(self):
158-
try:
159-
import sqlite3
160-
except ImportError:
161-
return
158+
sqlite3 = import_helper.import_module("sqlite3")
162159
returncode, events, stderr = self.run_python("test_sqlite3")
163160
if returncode:
164161
self.fail(stderr)

0 commit comments

Comments
 (0)