From cdf727722cf60632df81e852a6a2b973d856ef97 Mon Sep 17 00:00:00 2001 From: Nikita Pastukhov Date: Tue, 14 Nov 2023 15:40:07 +0300 Subject: [PATCH] test: PydanticV2.4 and V2.5 both supported --- tests/test_annotated.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_annotated.py b/tests/test_annotated.py index 2222be978..50443533d 100644 --- a/tests/test_annotated.py +++ b/tests/test_annotated.py @@ -1,5 +1,5 @@ import pytest -from dirty_equals import IsDict +from dirty_equals import IsDict, IsStr from fastapi import APIRouter, FastAPI, Query from fastapi.testclient import TestClient from fastapi.utils import match_pydantic_error_url @@ -57,7 +57,12 @@ foo_is_short = { { "ctx": {"min_length": 1}, "loc": ["query", "foo"], - "msg": "String should have at least 1 character", + "msg": ( + # PydanticV2.4 + IsStr("String should have at least 1 characters") or + # PydanticV2.5 + IsStr("String should have at least 1 character"), + ), "type": "string_too_short", "input": "", "url": match_pydantic_error_url("string_too_short"),