Coverage for tests/test_tutorial/test_settings/test_app02.py: 100%
13 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from pytest import MonkeyPatch 1abcde
3from ...utils import needs_pydanticv2 1abcde
6@needs_pydanticv2 1abcde
7def test_settings(monkeypatch: MonkeyPatch): 1abcde
8 from docs_src.settings.app02 import main 1abcde
10 monkeypatch.setenv("ADMIN_EMAIL", "admin@example.com") 1abcde
11 settings = main.get_settings() 1abcde
12 assert settings.app_name == "Awesome API" 1abcde
13 assert settings.items_per_user == 50 1abcde
16@needs_pydanticv2 1abcde
17def test_override_settings(): 1abcde
18 from docs_src.settings.app02 import test_main 1abcde
20 test_main.test_app() 1abcde