refactor(tests): Simplify test setup and fix client fixture
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import os
|
||||
# app/core/config.py
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
class Settings(BaseSettings):
|
||||
@@ -7,12 +7,7 @@ class Settings(BaseSettings):
|
||||
YANDEX_METRIKA_API_URL: str = "https://api-metrika.yandex.net"
|
||||
LOG_LEVEL: str = "INFO"
|
||||
|
||||
# ИЗМЕНЕНИЕ ЗДЕСЬ:
|
||||
# Если запущена среда pytest, используем .env.test, иначе .env
|
||||
if "PYTEST_CURRENT_TEST" in os.environ:
|
||||
model_config = SettingsConfigDict(env_file=".env.test")
|
||||
else:
|
||||
model_config = SettingsConfigDict(env_file=".env")
|
||||
|
||||
# Возвращаем простую и надежную конфигурацию
|
||||
model_config = SettingsConfigDict(env_file=".env")
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user