Chiusura fase di ristrutturazione e modularizzazione del workflow per favorire sviluppo modulare
This commit is contained in:
@@ -6,6 +6,7 @@ is not assumed reliable' gains real teeth for the data layer.
|
||||
"""
|
||||
import pytest
|
||||
from sqlalchemy import create_engine, text
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from tht.db.connection import can_create_in_schema, ping, writable_tables
|
||||
|
||||
@@ -43,10 +44,9 @@ def test_read_only_role_cannot_insert(ro_url):
|
||||
by our engine)."""
|
||||
engine = create_engine(ro_url)
|
||||
try:
|
||||
with pytest.raises(Exception):
|
||||
with engine.begin() as conn:
|
||||
conn.execute(text('INSERT INTO dw.dim_pazienti VALUES (999, %s, %s)'),
|
||||
("test", "test"))
|
||||
with pytest.raises(SQLAlchemyError), engine.begin() as conn:
|
||||
conn.execute(text('INSERT INTO dw.dim_pazienti VALUES (999, %s, %s)'),
|
||||
("test", "test"))
|
||||
finally:
|
||||
engine.dispose()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def test_unique_values_for_lsh_returns_most_frequent(admin_engine):
|
||||
schema = introspect(admin_engine, "testdb", "dw")
|
||||
# Before classify_all, all text columns are eligible=True by default. Sampling
|
||||
# only touches text types regardless.
|
||||
values, skipped, truncated = unique_values_for_lsh(
|
||||
values, _skipped, _truncated = unique_values_for_lsh(
|
||||
admin_engine, schema, LshConfig(max_values_per_column=100)
|
||||
)
|
||||
# dim_pazienti.citta: Milano, Bergamo, Brescia (3 distinct, all eligible text)
|
||||
|
||||
Reference in New Issue
Block a user