This commit is contained in:
@@ -5,6 +5,7 @@ import pytest
|
||||
from alembic import config
|
||||
from pytest_alembic.config import Config
|
||||
from streamlit.testing.v1 import AppTest
|
||||
import streamlit as st
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -18,11 +19,20 @@ def setup_database(alembic_runner):
|
||||
|
||||
@pytest.fixture
|
||||
def alembic_config() -> Config:
|
||||
logging.info("Setting up alembic config")
|
||||
logger.info("Setting up alembic config")
|
||||
alembic_cfg = config.Config(toml_file="pyproject.toml")
|
||||
alembic_cfg.set_main_option("sqlalchemy.url", os.getenv("DATABASE_URL", ""))
|
||||
return Config(alembic_config=alembic_cfg)
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def user_config():
|
||||
logger.info("Setting up test user")
|
||||
st.user = None
|
||||
st.session_state.user_id = 1
|
||||
st.session_state.user_name = "Test User"
|
||||
st.session_state.user_email = "test@test.local"
|
||||
st.session_state.user_external_id = "111-2222-3333"
|
||||
|
||||
@pytest.fixture
|
||||
def app() -> AppTest:
|
||||
return AppTest.from_file("app/streamlit_app.py")
|
||||
|
||||
Reference in New Issue
Block a user