From fcfc408c7c36fe2ea3a7400c1ce42c35f86f6ab8 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Sat, 14 May 2022 17:34:30 +0100 Subject: [PATCH] fix typing tests with 3.6 --- tests/test_typing.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_typing.py b/tests/test_typing.py index 9e5936574e..7d2b703d0d 100644 --- a/tests/test_typing.py +++ b/tests/test_typing.py @@ -1,6 +1,6 @@ import sys from collections import namedtuple -from typing import Any, Callable as TypingCallable, Dict, ForwardRef, List, NamedTuple, NewType, Union # noqa: F401 +from typing import Any, Callable as TypingCallable, Dict, List, NamedTuple, NewType, Union # noqa: F401 import pytest from typing_extensions import Annotated # noqa: F401 @@ -24,6 +24,12 @@ except ImportError: mypy_extensions_TypedDict = None +try: + from typing import ForwardRef +except ImportError: + # ForwardRef is only available in Python 3.6+ + pass + ALL_TYPEDDICT_KINDS = (typing_TypedDict, typing_extensions_TypedDict, mypy_extensions_TypedDict)