fix(config): поле uploads_ci вместо ci — раннеры CI выставляют CI=true
CI / ruff · mypy · pytest (pull_request) Successful in 1m38s

У Settings нет префикса env, поэтому переменная CI=true с раннера Gitea
попадала в поле ci и роняла создание настроек во всех тестах.

Refs #11

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 00:37:04 +03:00
co-authored by Claude Opus 5.5
parent 95a72437ec
commit 0c8f1f790b
3 changed files with 16 additions and 7 deletions
+9 -1
View File
@@ -3,7 +3,7 @@ from pathlib import Path
import pytest
from pydantic import ValidationError
from app.config import AccessSettings
from app.config import AccessSettings, Settings
from app.texts import load_texts
@@ -21,3 +21,11 @@ def test_texts_with_missing_key_fail_fast(tmp_path: Path) -> None:
(tmp_path / "texts.yaml").write_text("menu: {commit: x}\n", encoding="utf-8")
with pytest.raises(ValidationError):
load_texts(tmp_path)
def test_ci_runner_env_does_not_break_settings(monkeypatch: pytest.MonkeyPatch) -> None:
# Gitea/GitHub runners export CI=true; it must not collide with a settings field
monkeypatch.setenv("CI", "true")
monkeypatch.setenv("TELEGRAM_BOT_TOKEN", "42:x")
assert Settings().uploads_ci.provider == "none"