Skip to content

Commit

Permalink
Hack to ensure that env file isn't checked by Pydantic
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed May 2, 2024
1 parent e5641c0 commit 7f4ec5c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions timvt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
see: https://pydantic-docs.helpmanual.io/usage/settings/
"""

import sys
from functools import lru_cache
from typing import Any, Dict, List, Optional
from pydantic_settings import BaseSettings
import pydantic

import pydantic
from pydantic_settings import BaseSettings

# Pydantic does not support older versions of typing.TypedDict
# https://github.com/pydantic/pydantic/pull/3374
Expand Down Expand Up @@ -130,7 +131,7 @@ class PostgresSettings(BaseSettings):
class Config:
"""model config"""

env_file = ".env"
env_file = ".env-test"

# https://github.com/tiangolo/full-stack-fastapi-postgresql/blob/master/%7B%7Bcookiecutter.project_slug%7D%7D/backend/app/app/core/config.py#L42
@pydantic.validator("database_url", pre=True)
Expand Down

0 comments on commit 7f4ec5c

Please sign in to comment.