summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@protonmail.com>2022-07-26 21:18:16 +0200
committerGitHub <noreply@github.com>2022-07-26 21:18:16 +0200
commit152eb90311fdf294510b5d077332580ba18c0ee4 (patch)
treeff274f3cbad0eef070495fc52309cf24205e4eb5
parentb8c528694edb7a31020116956cc4daf07a5cd97f (diff)
downloadcpython-git-152eb90311fdf294510b5d077332580ba18c0ee4.tar.gz
gh-95291: Use import helper to improve sqlite3 audit tests (#95292)
Now the tests are correctly reported as skipped if sqlite3 is not available.
-rw-r--r--Lib/test/test_audit.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py
index 6a025f3991..a7ff038c09 100644
--- a/Lib/test/test_audit.py
+++ b/Lib/test/test_audit.py
@@ -155,10 +155,7 @@ class AuditTest(unittest.TestCase):
def test_sqlite3(self):
- try:
- import sqlite3
- except ImportError:
- return
+ sqlite3 = import_helper.import_module("sqlite3")
returncode, events, stderr = self.run_python("test_sqlite3")
if returncode:
self.fail(stderr)