File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 11import inspect
2- import sys
32from typing import Optional , Union
43
54import pytest
@@ -43,9 +42,19 @@ def tfunc(param: Union[int, str]):
4342 assert not _is_optional (param )
4443
4544
46- @pytest .mark .skipif ( sys . version_info < ( 3 , 10 ), reason = "requires python3 .10 or higher " )
45+ @pytest .mark .skip ( "We doesn't support 3 .10 annotation style yet. " )
4746def test_new_type_style ():
48- def tfunc (param : int | None ):
47+ def tfunc (param : "int | None" ):
48+ """Nothing."""
49+
50+ param = inspect .signature (tfunc ).parameters ["param" ]
51+
52+ assert _is_optional (param )
53+
54+
55+ @pytest .mark .skip ("We doesn't support string annotations yet." )
56+ def test_string_annotation ():
57+ def tfunc (param : "int | None" ):
4958 """Nothing."""
5059
5160 param = inspect .signature (tfunc ).parameters ["param" ]
You can’t perform that action at this time.
0 commit comments