summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_audit.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_audit.py')
-rw-r--r--Lib/test/test_audit.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py
index 456a5da..4ba62c4 100644
--- a/Lib/test/test_audit.py
+++ b/Lib/test/test_audit.py
@@ -130,6 +130,7 @@ class AuditTest(unittest.TestCase):
["gc.get_objects", "gc.get_referrers", "gc.get_referents"]
)
+
def test_http(self):
import_helper.import_module("http.client")
returncode, events, stderr = self.run_python("test_http_client")
@@ -145,5 +146,27 @@ class AuditTest(unittest.TestCase):
self.assertIn('HTTP', events[1][2])
+ def test_sqlite3(self):
+ try:
+ import sqlite3
+ except ImportError:
+ return
+ returncode, events, stderr = self.run_python("test_sqlite3")
+ if returncode:
+ self.fail(stderr)
+
+ if support.verbose:
+ print(*events, sep='\n')
+ actual = [ev[0] for ev in events]
+ expected = ["sqlite3.connect", "sqlite3.connect/handle"]
+
+ if hasattr(sqlite3.Connection, "enable_load_extension"):
+ expected += [
+ "sqlite3.enable_load_extension",
+ "sqlite3.load_extension",
+ ]
+ self.assertEqual(actual, expected)
+
+
if __name__ == "__main__":
unittest.main()