From 1c8b00be39317cb61b13caae4e45e29671f681b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 4 Jun 2023 21:03:01 +0200 Subject: [PATCH] Fix test_extra_used_as_enum to use pytest.warns() (#5994) --- tests/test_deprecated.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_deprecated.py b/tests/test_deprecated.py index 29755b6079..e373c071e8 100644 --- a/tests/test_deprecated.py +++ b/tests/test_deprecated.py @@ -319,7 +319,7 @@ def test_extra_used_as_enum( attribute: str, value: str, ) -> None: - with pytest.raises( + with pytest.warns( DeprecationWarning, match=re.escape("`pydantic.config.Extra` is deprecated, use literal values instead (e.g. `extra='allow'`)"), ):