From e0d987fee6c75aad981159ece8f5a2cb83d3029a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Fri, 12 Dec 2025 15:22:14 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=85=20Tweak=20test=20for=20coverage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_union_body_discriminator_annotated.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_union_body_discriminator_annotated.py b/tests/test_union_body_discriminator_annotated.py index 503b7978d..14145e6f6 100644 --- a/tests/test_union_body_discriminator_annotated.py +++ b/tests/test_union_body_discriminator_annotated.py @@ -26,9 +26,8 @@ def client_fixture() -> TestClient: barks: float def get_pet_type(v): - if isinstance(v, dict): - return v.get("pet_type", "") - return getattr(v, "pet_type", "") + assert isinstance(v, dict) + return v.get("pet_type", "") Pet = Annotated[ Union[Annotated[Cat, Tag("cat")], Annotated[Dog, Tag("dog")]],