fix: garantir limpeza de CLIENTE_CONTATO mesmo se assert falhar (test_excluir_cliente_com_contato_bloqueia)
This commit is contained in:
@@ -98,12 +98,13 @@ def test_excluir_cliente_com_contato_bloqueia(cliente_id):
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
with pytest.raises(db_clientes.ClienteComDependenciasError):
|
||||
db_clientes.excluir_cliente(cliente_id)
|
||||
|
||||
conn = get_connection()
|
||||
try:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("DELETE FROM CLIENTE_CONTATO WHERE CLIENTE_ID = %s", (cliente_id,))
|
||||
with pytest.raises(db_clientes.ClienteComDependenciasError):
|
||||
db_clientes.excluir_cliente(cliente_id)
|
||||
finally:
|
||||
conn.close()
|
||||
conn = get_connection()
|
||||
try:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("DELETE FROM CLIENTE_CONTATO WHERE CLIENTE_ID = %s", (cliente_id,))
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
Reference in New Issue
Block a user