-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Perhaps more tests can be written using transaction rollback rather than manual data cleanup.
We can take this example: https://docs.sqlalchemy.org/en/20/orm/session_transaction.html#joining-a-session-into-an-external-transaction-such-as-for-test-suites
The idea: in conftest, a session is created as it is now. But instead of adding it to the context, you can create a new session with join_transaction_mode="create_savepoint." This way, the application will be able to commit the transaction, but will actually be working on the save point.
Metadata
Metadata
Assignees
Labels
No labels