fix(config): поле uploads_ci вместо ci — раннеры CI выставляют CI=true
CI / ruff · mypy · pytest (pull_request) Successful in 1m38s
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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user