Fix CREATE VIEW analysis on Python 3.10

This commit is contained in:
Simon Willison 2026-09-03 16:43:50 -07:00
commit d06737b6f4
2 changed files with 15 additions and 3 deletions

View file

@ -439,7 +439,7 @@ def test_analyze_attached_database_tables(conn):
}
def test_analyze_clears_authorizer_on_error():
def test_analyze_disables_authorizer_on_error():
class FakeConnection:
def __init__(self):
self.authorizers = []
@ -455,4 +455,5 @@ def test_analyze_clears_authorizer_on_error():
with pytest.raises(sqlite3.OperationalError):
analyze_sql_tables(conn, "bad SQL")
assert conn.authorizers[-1] is None
final_authorizer = conn.authorizers[-1]
assert final_authorizer is None or final_authorizer() == sqlite3.SQLITE_OK