Spaces:
Sleeping
Sleeping
import pytest | |
from app.engine.postgresdb import get_db | |
def test_postgres_db_connection(): | |
""" | |
Tests the connection to the postgres db | |
""" | |
with get_db() as session: | |
# Execute a query to test the connection | |
result = session.execute(f"SELECT 1").scalar() | |
# Assert that the result is equal to 1 | |
assert result == 1 | |