gh-95291: Use import helper to improve sqlite3 audit tests (#95292)

Now the tests are correctly reported as skipped if sqlite3 is not available.
This commit is contained in:
Erlend Egeberg Aasland 2022-07-26 21:18:16 +02:00 committed by GitHub
parent b8c528694e
commit 152eb90311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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)