From a33a980e4745fb15f8b5d4b727090c5338225089 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 09:14:29 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20[pre-commit.ci]=20Auto=20format?= =?UTF-8?q?=20from=20pre-commit.com=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_color_compat.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_color_compat.py b/tests/test_color_compat.py index 019e4ce54..9b2b5cae0 100644 --- a/tests/test_color_compat.py +++ b/tests/test_color_compat.py @@ -1,4 +1,5 @@ import warnings + import pydantic try: @@ -6,12 +7,16 @@ try: except ImportError: from pydantic.color import Color # triggers DeprecationWarning on v1 + class Model(pydantic.BaseModel): c: Color + def test_color_deprecation_warning(): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") m = Model(c="#FF0000") - dep_warnings = [warn for warn in w if issubclass(warn.category, DeprecationWarning)] + dep_warnings = [ + warn for warn in w if issubclass(warn.category, DeprecationWarning) + ] assert len(dep_warnings) == 0, "DeprecationWarning raised! Fixed in this PR"