Skip to content

Commit f118661

Browse files
gh-95291: Use import helper to improve sqlite3 audit tests (GH-95292)
Now the tests are correctly reported as skipped if sqlite3 is not available. (cherry picked from commit 152eb90) Co-authored-by: Erlend Egeberg Aasland <[email protected]>
1 parent 2f9e47c commit f118661

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Lib/test/test_audit.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,7 @@ def test_http(self):
152152

153153

154154
def test_sqlite3(self):
155-
try:
156-
import sqlite3
157-
except ImportError:
158-
return
155+
sqlite3 = import_helper.import_module("sqlite3")
159156
returncode, events, stderr = self.run_python("test_sqlite3")
160157
if returncode:
161158
self.fail(stderr)

0 commit comments

Comments
 (0)