Browse Source

Tweak test for coverage

pull/14512/head
Sebastián Ramírez 7 months ago
parent
commit
e0d987fee6
  1. 5
      tests/test_union_body_discriminator_annotated.py

5
tests/test_union_body_discriminator_annotated.py

@ -26,9 +26,8 @@ def client_fixture() -> TestClient:
barks: float barks: float
def get_pet_type(v): def get_pet_type(v):
if isinstance(v, dict): assert isinstance(v, dict)
return v.get("pet_type", "") return v.get("pet_type", "")
return getattr(v, "pet_type", "")
Pet = Annotated[ Pet = Annotated[
Union[Annotated[Cat, Tag("cat")], Annotated[Dog, Tag("dog")]], Union[Annotated[Cat, Tag("cat")], Annotated[Dog, Tag("dog")]],

Loading…
Cancel
Save