🐛 Fix TYPE_CHECKING annotations for Python 3.14 (PEP 649) (#14789)

This commit is contained in:
Mickaël Guérin authored and GitHub committed 2026-02-04 14:49:44 +01:00
1 parent c944add5a9
commit 09f5941f0e
4 files changed
+46 -5

No files matched your search

@@ -1,4 +1,5 @@
import importlib
import sys
from types import ModuleType
from typing import Annotated, Any
from unittest.mock import Mock, patch
@@ -12,8 +13,13 @@ from fastapi.testclient import TestClient
name="module",
params=[
"tutorial008_py39",
# Fails with `NameError: name 'DepA' is not defined`
pytest.param("tutorial008_an_py39", marks=pytest.mark.xfail),
pytest.param(
"tutorial008_an_py39",
marks=pytest.mark.xfail(
sys.version_info < (3, 14),
reason="Fails with `NameError: name 'DepA' is not defined`",
),
),
],
)
def get_module(request: pytest.FixtureRequest):