global theming

This commit is contained in:
John Lancaster
2026-08-03 22:56:04 -05:00
parent edb6967888
commit 5932c0d3a1
10 changed files with 152 additions and 138 deletions
+4 -12
View File
@@ -8,19 +8,11 @@ from transcription import __main__ as entrypoint
@pytest.mark.unit
def test_main_passes_constructed_app_to_uvicorn(monkeypatch):
"""Non-reload execution keeps the parsed settings instance in the app."""
def test_main_uses_cli_factory_import_string(monkeypatch):
"""Startup uses an importable factory so Uvicorn owns app creation."""
settings = SimpleNamespace(host="127.0.0.1", port=8123, log_level="debug", reload=False)
application = object()
captured = {}
def create_app(*, settings: object) -> object:
assert settings is expected_settings
return application
expected_settings = settings
monkeypatch.setattr(entrypoint, "parse_cli_settings", lambda: settings)
monkeypatch.setattr(entrypoint, "create_app", create_app)
monkeypatch.setattr(
entrypoint.uvicorn,
"run",
@@ -30,8 +22,8 @@ def test_main_passes_constructed_app_to_uvicorn(monkeypatch):
entrypoint.main()
assert captured == {
"application": application,
"factory": False,
"application": "transcription.__main__:create_cli_app",
"factory": True,
"host": "127.0.0.1",
"port": 8123,
"log_level": "debug",