From 7a39d5b85ff5e9ca2d9aa53c87c0cf2947abfd6e Mon Sep 17 00:00:00 2001 From: Adarsh Bennur Date: Sat, 7 Feb 2026 00:38:40 +0530 Subject: [PATCH] Fix: Use typing_extensions.Annotated for Python 3.8 compatibility Python 3.8 does not have Annotated in typing module (added in 3.9). Using typing_extensions ensures tests run on all Python versions. Added noqa: UP035 to suppress ruff's preference for typing module, since typing_extensions is required for Python 3.8 support. --- tests/test_forms_fields_set.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_forms_fields_set.py b/tests/test_forms_fields_set.py index de4c743737..8ffbdc3ebe 100644 --- a/tests/test_forms_fields_set.py +++ b/tests/test_forms_fields_set.py @@ -6,12 +6,11 @@ This test validates that Form models correctly track which fields were explicitly provided vs. which fields use defaults. """ -from typing import Annotated - import pydantic from fastapi import FastAPI, Form, Header, Query from fastapi.testclient import TestClient from pydantic import BaseModel +from typing_extensions import Annotated # noqa: UP035 PYDANTIC_V2 = int(pydantic.VERSION.split(".")[0]) >= 2