From 43771601550577beca38db88643128972ece1925 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 27 Nov 2022 00:32:18 -0700 Subject: Force testing settings during test --- takahe/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'takahe') diff --git a/takahe/settings.py b/takahe/settings.py index bc55711..142c690 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -1,4 +1,5 @@ import secrets +import sys import urllib.parse from pathlib import Path from typing import List, Literal, Optional, Union @@ -105,7 +106,7 @@ class Settings(BaseSettings): } -SETUP = Settings() +SETUP = Settings(_env_file="test.env" if "pytest" in sys.modules else None) SECRET_KEY = SETUP.SECRET_KEY DEBUG = SETUP.DEBUG -- cgit v1.2.3