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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user