48 changed files with 18 additions and 346 deletions
@ -4,8 +4,6 @@ from types import ModuleType |
|||||
import pytest |
import pytest |
||||
from pytest import MonkeyPatch |
from pytest import MonkeyPatch |
||||
|
|
||||
from ...utils import needs_pydanticv2 |
|
||||
|
|
||||
|
|
||||
@pytest.fixture( |
@pytest.fixture( |
||||
name="mod_path", |
name="mod_path", |
||||
@ -31,7 +29,6 @@ def get_test_main_mod(mod_path: str) -> ModuleType: |
|||||
return test_main_mod |
return test_main_mod |
||||
|
|
||||
|
|
||||
@needs_pydanticv2 |
|
||||
def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
||||
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
||||
settings = main_mod.get_settings() |
settings = main_mod.get_settings() |
||||
@ -39,6 +36,5 @@ def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
|||||
assert settings.items_per_user == 50 |
assert settings.items_per_user == 50 |
||||
|
|
||||
|
|
||||
@needs_pydanticv2 |
|
||||
def test_override_settings(test_main_mod: ModuleType): |
def test_override_settings(test_main_mod: ModuleType): |
||||
test_main_mod.test_app() |
test_main_mod.test_app() |
||||
|
|||||
@ -5,7 +5,7 @@ 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, needs_pydanticv2 |
from ...utils import needs_pydanticv1 |
||||
|
|
||||
|
|
||||
@pytest.fixture( |
@pytest.fixture( |
||||
@ -26,7 +26,6 @@ def get_main_mod(mod_path: str) -> ModuleType: |
|||||
return main_mod |
return main_mod |
||||
|
|
||||
|
|
||||
@needs_pydanticv2 |
|
||||
def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
def test_settings(main_mod: ModuleType, monkeypatch: MonkeyPatch): |
||||
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
monkeypatch.setenv("ADMIN_EMAIL", "[email protected]") |
||||
settings = main_mod.get_settings() |
settings = main_mod.get_settings() |
||||
@ -45,7 +44,6 @@ def test_settings_pv1(mod_path: str, monkeypatch: MonkeyPatch): |
|||||
assert settings.items_per_user == 50 |
assert settings.items_per_user == 50 |
||||
|
|
||||
|
|
||||
@needs_pydanticv2 |
|
||||
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) |
||||
|
|||||
Loading…
Reference in new issue