File: test_app02.py

package info (click to toggle)
fastapi 0.118.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,212 kB
  • sloc: python: 69,848; javascript: 369; sh: 18; makefile: 17
file content (20 lines) | stat: -rw-r--r-- 488 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pytest import MonkeyPatch

from ...utils import needs_pydanticv2


@needs_pydanticv2
def test_settings(monkeypatch: MonkeyPatch):
    from docs_src.settings.app02 import main

    monkeypatch.setenv("ADMIN_EMAIL", "admin@example.com")
    settings = main.get_settings()
    assert settings.app_name == "Awesome API"
    assert settings.items_per_user == 50


@needs_pydanticv2
def test_override_settings():
    from docs_src.settings.app02 import test_main

    test_main.test_app()