From 7ab0d2a04b59c473a3f11549b4a569825e1247fd Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 9 Oct 2025 22:49:03 +0200 Subject: [PATCH 1/2] Ignore `on_event is deprecated` warning --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index cd47f5ecd9..fabc7b3891 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,3 +133,8 @@ known-third-party = ["sqlmodel", "sqlalchemy", "pydantic", "fastapi"] [tool.ruff.lint.pyupgrade] # Preserve types, even if a file imports `from __future__ import annotations`. keep-runtime-typing = true + +[tool.pytest.ini_options] +filterwarnings = [ + "ignore:(?s).*on_event is deprecated.*:DeprecationWarning", +] From 7c8a3308d1ccf4c4e5c6b97ac44471532e8f4bec Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Thu, 9 Oct 2025 22:50:35 +0200 Subject: [PATCH 2/2] Fix `ValidationError` import deprecation warning --- tests/test_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_validation.py b/tests/test_validation.py index 3265922070..e44d207972 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -1,7 +1,7 @@ from typing import Optional import pytest -from pydantic.error_wrappers import ValidationError +from pydantic import ValidationError from sqlmodel import SQLModel from .conftest import needs_pydanticv1, needs_pydanticv2