File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -215,11 +215,8 @@ def test_signature_annotations():
215215
216216 # optional union
217217 sig = inspect .signature (f20 )
218- if sys .version_info < (3 , 7 ):
219- assert stringify_signature (sig ) in ('() -> Optional[Union[int, str]]' ,
220- '() -> Optional[Union[str, int]]' )
221- else :
222- assert stringify_signature (sig ) == '() -> Optional[Union[int, str]]'
218+ assert stringify_signature (sig ) in ('() -> Optional[Union[int, str]]' ,
219+ '() -> Optional[Union[str, int]]' )
223220
224221 # Any
225222 sig = inspect .signature (f14 )
Original file line number Diff line number Diff line change @@ -142,9 +142,9 @@ def test_restify_type_Literal():
142142
143143@pytest .mark .skipif (sys .version_info < (3 , 10 ), reason = 'python 3.10+ is required.' )
144144def test_restify_type_union_operator ():
145- assert restify (int | None ) == "Optional[ :class:`int`] " # type: ignore
145+ assert restify (int | None ) == ":class:`int` | :obj:`None` " # type: ignore
146146 assert restify (int | str ) == ":class:`int` | :class:`str`" # type: ignore
147- assert restify (int | str | None ) == "Optional[ :class:`int` | :class:`str`] " # type: ignore
147+ assert restify (int | str | None ) == ":class:`int` | :class:`str` | :obj:`None` " # type: ignore
148148
149149
150150def test_restify_broken_type_hints ():
@@ -253,9 +253,9 @@ def test_stringify_type_Literal():
253253
254254@pytest .mark .skipif (sys .version_info < (3 , 10 ), reason = 'python 3.10+ is required.' )
255255def test_stringify_type_union_operator ():
256- assert stringify (int | None ) == "Optional[ int] " # type: ignore
256+ assert stringify (int | None ) == "int | None " # type: ignore
257257 assert stringify (int | str ) == "int | str" # type: ignore
258- assert stringify (int | str | None ) == "Optional[ int | str] " # type: ignore
258+ assert stringify (int | str | None ) == "int | str | None " # type: ignore
259259
260260
261261def test_stringify_broken_type_hints ():
You can’t perform that action at this time.
0 commit comments