updated tests to work without .env file

This commit is contained in:
2026-03-04 23:07:53 -07:00
parent e34f82b181
commit e743167ba5
6 changed files with 48 additions and 15 deletions
+4 -13
View File
@@ -25,22 +25,13 @@ def test_settings_with_all_values():
def test_settings_defaults():
"""Test Settings uses defaults for optional values."""
settings = Settings(
anthropic_api_key="sk-ant-test" # Only required field
anthropic_api_key="sk-ant-test", # Only required field
_env_file=None,
)
# Should use defaults
assert settings.model == "claude-sonnet-4-5-20250929"
assert settings.max_tokens == 8096
@pytest.mark.unit
def test_settings_missing_required_field():
"""Test Settings raises error when required field is missing."""
with pytest.raises(ValidationError) as exc_info:
Settings(_env_file=None) # Missing anthropic_api_key
# Verify the error mentions the missing field
assert "anthropic_api_key" in str(exc_info.value)
assert settings.model == "claude-test-model"
assert settings.max_tokens == 100
@pytest.mark.unit