From 3bf1a9a373fc783c9d2007edcf63f98a027957e1 Mon Sep 17 00:00:00 2001 From: Mortdecai Date: Fri, 10 Apr 2026 01:28:58 -0400 Subject: [PATCH] feat: add run script and finalize test fixtures --- run.py | 20 ++++++++++++++++++++ tests/conftest.py | 23 ++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 run.py diff --git a/run.py b/run.py new file mode 100644 index 0000000..39fd2c8 --- /dev/null +++ b/run.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 +"""Entry point for AI Hell server.""" + +import logging +import uvicorn + +from server.config import config + +logging.basicConfig( + level=logging.INFO, + format="%(asctime)s [%(name)s] %(levelname)s: %(message)s", +) + +if __name__ == "__main__": + uvicorn.run( + "server.main:app", + host=config.host, + port=config.port, + log_level="info", + ) diff --git a/tests/conftest.py b/tests/conftest.py index 5632edd..bcc1755 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1 +1,22 @@ -"""Shared test fixtures.""" +"""Shared test fixtures for AI Hell.""" + +import tempfile +from pathlib import Path + +import pytest + +from server.config import config + + +@pytest.fixture +def tmp_assets(tmp_path): + """Temporary assets directory for pool tests.""" + return tmp_path + + +@pytest.fixture(autouse=True) +def _reset_config(): + """Reset config to defaults between tests.""" + # Config is a module-level singleton; tests shouldn't mutate it + # but if they do, this ensures isolation + yield