DispelEvilBot/tests/conftest.py

21 lines
518 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""Общие фикстуры тестов."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any
import pytest
from common.config import Settings
@pytest.fixture
def settings_factory() -> Callable[..., Settings]:
"""Фабрика ``Settings`` с обязательным ``BOT_TOKEN`` и без чтения ``.env``."""
def _factory(**overrides: Any) -> Settings:
return Settings(_env_file=None, bot_token="1:a", **overrides)
return _factory