3 changed files with 1 additions and 23 deletions
@ -5,8 +5,6 @@ import pytest |
|||||
from fastapi.testclient import TestClient |
from fastapi.testclient import TestClient |
||||
from pytest import MonkeyPatch |
from pytest import MonkeyPatch |
||||
|
|
||||
from ...utils import needs_pydanticv1 |
|
||||
|
|
||||
|
|
||||
@pytest.fixture( |
@pytest.fixture( |
||||
name="mod_path", |
name="mod_path", |
||||
@ -34,16 +32,6 @@ def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
|||||
assert settings.items_per_user == 50 |
assert settings.items_per_user == 50 |
||||
|
|
||||
|
|
||||
@needs_pydanticv1 |
|
||||
def test_settings_pv1(mod_path: str, monkeypatch: MonkeyPatch): |
|
||||
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
|
||||
config_mod = importlib.import_module(f"{mod_path}.config_pv1") |
|
||||
settings = config_mod.Settings() |
|
||||
assert settings.app_name == "Awesome API" |
|
||||
assert settings.admin_email == "[email protected]" |
|
||||
assert settings.items_per_user == 50 |
|
||||
|
|
||||
|
|
||||
def test_endpoint(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
def test_endpoint(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
||||
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
||||
client = TestClient(main_mod.app) |
client = TestClient(main_mod.app) |
||||
|
|||||
@ -4,16 +4,8 @@ import pytest |
|||||
from fastapi.testclient import TestClient |
from fastapi.testclient import TestClient |
||||
from pytest import MonkeyPatch |
from pytest import MonkeyPatch |
||||
|
|
||||
from ...utils import needs_pydanticv1 |
|
||||
|
|
||||
|
@pytest.fixture(name="app", params=[pytest.param("tutorial001_py39")]) |
||||
@pytest.fixture( |
|
||||
name="app", |
|
||||
params=[ |
|
||||
pytest.param("tutorial001_py39"), |
|
||||
pytest.param("tutorial001_pv1_py39", marks=needs_pydanticv1), |
|
||||
], |
|
||||
) |
|
||||
def get_app(request: pytest.FixtureRequest, monkeypatch: MonkeyPatch): |
def get_app(request: pytest.FixtureRequest, monkeypatch: MonkeyPatch): |
||||
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
||||
mod = importlib.import_module(f"docs_src.settings.{request.param}") |
mod = importlib.import_module(f"docs_src.settings.{request.param}") |
||||
|
|||||
Loading…
Reference in new issue