21 lines
518 B
Python
21 lines
518 B
Python
"""Общие фикстуры тестов."""
|
||
|
||
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
|