Skip to content

Commit baf7487

Browse files
Python 3.6 specific check
1 parent aba1d04 commit baf7487

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/typeapi/utils_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import typing_extensions
1010

1111
from typeapi.utils import (
12+
IS_PYTHON_AT_LEAST_3_7,
1213
IS_PYTHON_AT_LEAST_3_9,
1314
ForwardRef,
1415
get_annotations,
@@ -463,11 +464,14 @@ class A:
463464

464465
assert type(annotations["a"]) is _UnionGenericAlias
465466

466-
else:
467+
elif IS_PYTHON_AT_LEAST_3_7:
467468
from typing import _GenericAlias # type: ignore
468469

469470
assert type(annotations["a"]) is _GenericAlias
470471

472+
else:
473+
assert str(type(annotations["a"])) == "typing.Union"
474+
471475

472476
def test__get_annotations__evaluate_forward_references_on_class_level() -> None:
473477
class A:

0 commit comments

Comments
 (0)