You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unresolved annotations shouldn't throw errors on Python 3.14 #13549
Especially during testing of a new release, I often comment out dependencies and add collect_ignore_glob = ["test_*.py"] to conftest to skip test collection for a whole block for tests which depend on in incompatible dependency. With Python 3.14 the evaluation of annotations is deferred by default, so pytest shouldn't throw an error if a name is undefined. A similar result could previously be archived by adding from __future__ import annotations.
As far as I'm aware, pytest doesn't care about annotations. A possible solution would be to add a compatibility layer to the inspect.signature call with annotation_format=Format.STRING as added argument. In particular here:
Maybe a more common case is actually typing only imports being behind if TYPE_CHECKING guards. This also raises a NameError currently but should work fine on Python 3.14+.
Activity
cdce8p commentedon Jun 22, 2025
Maybe a more common case is actually typing only imports being behind
if TYPE_CHECKINGguards. This also raises aNameErrorcurrently but should work fine on Python 3.14+.Defer annotation eval on Python 3.14 (#13550)
Defer annotation eval on Python 3.14 (#13550)
Defer annotation eval on Python 3.14 (#13550) (#13553)
chore(deps): update dependency pytest to v9 (#305)