We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aba1d04 commit baf7487Copy full SHA for baf7487
src/typeapi/utils_test.py
@@ -9,6 +9,7 @@
9
import typing_extensions
10
11
from typeapi.utils import (
12
+ IS_PYTHON_AT_LEAST_3_7,
13
IS_PYTHON_AT_LEAST_3_9,
14
ForwardRef,
15
get_annotations,
@@ -463,11 +464,14 @@ class A:
463
464
465
assert type(annotations["a"]) is _UnionGenericAlias
466
- else:
467
+ elif IS_PYTHON_AT_LEAST_3_7:
468
from typing import _GenericAlias # type: ignore
469
470
assert type(annotations["a"]) is _GenericAlias
471
472
+ else:
473
+ assert str(type(annotations["a"])) == "typing.Union"
474
+
475
476
def test__get_annotations__evaluate_forward_references_on_class_level() -> None:
477
class A:
0 commit comments