fix tests (#25)

* fix tests

* remove unnecessary mypy ignore
This commit is contained in:
Dmitry Afanasyev 2023-10-03 20:32:12 +03:00 committed by GitHub
parent 47c7524cf8
commit 482e1fdda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,6 +64,7 @@ class AppSettings(SentrySettings, BaseSettings):
@model_validator(mode="before") # type: ignore[arg-type] @model_validator(mode="before") # type: ignore[arg-type]
def validate_boolean_fields(self) -> Any: def validate_boolean_fields(self) -> Any:
values_dict: dict[str, Any] = self # type: ignore[assignment]
for value in ( for value in (
"ENABLE_JSON_LOGS", "ENABLE_JSON_LOGS",
"ENABLE_SENTRY_LOGS", "ENABLE_SENTRY_LOGS",
@ -71,9 +72,10 @@ class AppSettings(SentrySettings, BaseSettings):
"RELOAD", "RELOAD",
"DEBUG", "DEBUG",
): ):
if self.get(value).lower() == "false": # type: ignore[attr-defined] setting_value: str | None = values_dict.get(value)
self[value] = False # type: ignore[index] if setting_value and setting_value.lower() == "false":
return self values_dict[value] = False
return values_dict
@cached_property @cached_property
def api_prefix(self) -> str: def api_prefix(self) -> str: