summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2021-05-02 21:25:17 (GMT)
committerGitHub <noreply@github.com>2021-05-02 21:25:17 (GMT)
commitc96cc089f60d2bf7e003c27413c3239ee9de2990 (patch)
treed93d46ef410fdda18eab4d3a75cc55af541387e9 /Lib
parent37e0c7850de902179b28f1378fbbc38a5ed3628c (diff)
downloadcpython-c96cc089f60d2bf7e003c27413c3239ee9de2990.zip
cpython-c96cc089f60d2bf7e003c27413c3239ee9de2990.tar.gz
cpython-c96cc089f60d2bf7e003c27413c3239ee9de2990.tar.bz2
bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/audit-tests.py7
-rw-r--r--Lib/test/test_audit.py2
2 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/audit-tests.py b/Lib/test/audit-tests.py
index ed42451..7a7de63 100644
--- a/Lib/test/audit-tests.py
+++ b/Lib/test/audit-tests.py
@@ -367,13 +367,14 @@ def test_sqlite3():
print(event, *args)
sys.addaudithook(hook)
- cx = sqlite3.connect(":memory:")
+ cx1 = sqlite3.connect(":memory:")
+ cx2 = sqlite3.Connection(":memory:")
# Configured without --enable-loadable-sqlite-extensions
if hasattr(sqlite3.Connection, "enable_load_extension"):
- cx.enable_load_extension(False)
+ cx1.enable_load_extension(False)
try:
- cx.load_extension("test")
+ cx1.load_extension("test")
except sqlite3.OperationalError:
pass
else:
diff --git a/Lib/test/test_audit.py b/Lib/test/test_audit.py
index 4ba62c4..25ff34b 100644
--- a/Lib/test/test_audit.py
+++ b/Lib/test/test_audit.py
@@ -158,7 +158,7 @@ class AuditTest(unittest.TestCase):
if support.verbose:
print(*events, sep='\n')
actual = [ev[0] for ev in events]
- expected = ["sqlite3.connect", "sqlite3.connect/handle"]
+ expected = ["sqlite3.connect", "sqlite3.connect/handle"] * 2
if hasattr(sqlite3.Connection, "enable_load_extension"):
expected += [