🐛 fix(base.py): use db_manager.engine instead of DatabaseManager.engine to access the database engine

🐛 fix(conftest.py): add TYPE_CHECKING import to fix type hinting error
🐛 fix(conftest.py): pass db_manager to blank_session_getter fixture to fix session creation error
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-08-06 12:15:29 -03:00
commit a9db2da6bf
2 changed files with 8 additions and 5 deletions

View file

@ -70,7 +70,7 @@ class DatabaseManager(Service):
@contextmanager
def session_getter(db_manager: DatabaseManager):
try:
session = Session(DatabaseManager.engine)
session = Session(db_manager.engine)
yield session
except Exception as e:
print("Session rollback because of exception:", e)