()
| 456 | |
| 457 | |
| 458 | def 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 | |
| 483 | def test_sys_getframe(): |
| 484 | import sys |
nothing calls this directly
no test coverage detected
searching dependent graphs…