Use the sa alias for sqlalchemy everywhere
`sa` is the common alias, also in SQLAlchemy's own documentation
This commit is contained in:
parent
a85ba4c4c4
commit
e30b3efbe8
1 changed files with 29 additions and 29 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import datetime as dt
|
||||
|
||||
import pytest
|
||||
import sqlalchemy as sqla
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy import exc as sa_exc
|
||||
|
||||
from tests import config as test_config
|
||||
|
|
@ -44,7 +44,7 @@ class TestConstraints:
|
|||
db_session.commit()
|
||||
|
||||
# Must delete without ORM as otherwise an UPDATE statement is emitted.
|
||||
stmt = sqla.delete(db.ReplaySimulation).where(
|
||||
stmt = sa.delete(db.ReplaySimulation).where(
|
||||
db.ReplaySimulation.id == replayed_order.simulation.id,
|
||||
)
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ class TestConstraints:
|
|||
db_session.commit()
|
||||
|
||||
# Must delete without ORM as otherwise an UPDATE statement is emitted.
|
||||
stmt = sqla.delete(db.Order).where(db.Order.id == replayed_order.actual.id)
|
||||
stmt = sa.delete(db.Order).where(db.Order.id == replayed_order.actual.id)
|
||||
|
||||
with pytest.raises(sa_exc.IntegrityError, match="fk_replayed_orders_to_orders"):
|
||||
db_session.execute(stmt)
|
||||
|
|
@ -80,7 +80,7 @@ class TestConstraints:
|
|||
db_session.commit()
|
||||
|
||||
# Must delete without ORM as otherwise an UPDATE statement is emitted.
|
||||
stmt = sqla.delete(db.Courier).where(db.Courier.id == replayed_order.courier.id)
|
||||
stmt = sa.delete(db.Courier).where(db.Courier.id == replayed_order.courier.id)
|
||||
|
||||
with pytest.raises(
|
||||
sa_exc.IntegrityError,
|
||||
|
|
|
|||
Loading…
Reference in a new issue