MCPcopy Index your code
hub / github.com/python/cpython / test_sqlite3

Function test_sqlite3

Lib/test/audit-tests.py:458–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

456
457
458def test_sqlite3():
459 import sqlite3
460
461 def hook(event, *args):
462 if event.startswith("sqlite3."):
463 print(event, *args)
464
465 sys.addaudithook(hook)
466 cx1 = sqlite3.connect(":memory:")
467 cx2 = sqlite3.Connection(":memory:")
468
469 # Configured without --enable-loadable-sqlite-extensions
470 try:
471 if hasattr(sqlite3.Connection, "enable_load_extension"):
472 cx1.enable_load_extension(False)
473 try:
474 cx1.load_extension("test")
475 except sqlite3.OperationalError:
476 pass
477 else:
478 raise RuntimeError("Expected sqlite3.load_extension to fail")
479 finally:
480 cx1.close()
481 cx2.close()
482
483def test_sys_getframe():
484 import sys

Callers

nothing calls this directly

Calls 4

closeMethod · 0.95
load_extensionMethod · 0.80
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…