Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Test setup flow - why such complex db initialization? #11

Copy link
Copy link
Open
@guyarad

Description

@guyarad
Issue body actions

This is more of a question/discussion - I'm trying to understand if there's a reason for the rather complex "session" fixture.
If you have an actual PG database already setup, all tables were recreated by setup_test_db (that said, this is happening per session and not per test), why do you need a special flow to create the session and override the fast api dependency?

Some observations I made -

  1. The engine is returned before the transaction is completed in setup_test_db - is that how you are making sure the db remains clean?
  2. That said, you begin a new transaction in session fixture. At the end, you rollback the connection (but assuming some "commits" might have happened).
  3. end_savepoint - what is the point of it? if I understand correctly, it will automatically re-start a nested transaction when one is over in a sync session. But why?

Appreciate your clarifications!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.