Disable settings for testing

pull/377/head
Ivan Habunek 2023-06-28 14:55:28 +02:00
rodzic 38487a0774
commit 7da372e4a8
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: CDBD63C43A30BB95
2 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -26,6 +26,11 @@ from toot.exceptions import ApiError, ConsoleError
from toot.output import print_out
def pytest_configure(config):
import toot.settings
toot.settings.DISABLE_SETTINGS = True
# Mastodon database name, used to confirm user registration without having to click the link
DATABASE_DSN = os.getenv("TOOT_TEST_DATABASE_DSN")

Wyświetl plik

@ -8,6 +8,8 @@ from toot import get_config_dir
from typing import Optional, Type
DISABLE_SETTINGS = False
TOOT_SETTINGS_FILE_NAME = "settings.toml"
@ -16,6 +18,10 @@ def get_settings_path():
def load_settings() -> dict:
# Used for testing without config file
if DISABLE_SETTINGS:
return {}
path = get_settings_path()
if not exists(path):