Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests should be performed on a SQLite test db #1

Open
igorbenav opened this issue Oct 5, 2023 · 3 comments
Open

Tests should be performed on a SQLite test db #1

igorbenav opened this issue Oct 5, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@igorbenav
Copy link
Owner

No description provided.

@igorbenav igorbenav added the enhancement New feature or request label Oct 5, 2023
@igorbenav
Copy link
Owner Author

Maybe just overriding the dependency will be a simpler solution with the same benefits

@mithun2003
Copy link

mithun2003 commented Feb 19, 2024

In one of our projects, we encountered an issue with a test case. The problem was identified in the following code snippet:

`async def async_get_db() -> AsyncSession:
     async_session = local_session
     async with async_session() as db:
         yield db
         db.commit()`

The last db.commit() statement was saving data to the database during test execution. Upon removing this line, the data was no longer saved during testing, and the test case started working as expected. It's worth noting that regular database data saving continued to function properly.

@igorbenav igorbenav assigned igorbenav and unassigned igorbenav Feb 19, 2024
@igorbenav
Copy link
Owner Author

Hey, @mithun2003, thanks! I'll change it. I should also fix the tests and do this migration to SQLite as soon as possible, trying to find the time

@igorbenav igorbenav self-assigned this Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants