@@ -232,7 +232,7 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
232232 (S , ":py:class:`~typing.TypeVar`\\ (``S``, bound= miss)" ),
233233 # ## These test for correct internal tuple rendering, even if not all are valid Tuple types
234234 # Zero-length tuple remains
235- (Tuple [()], ":py:data:`~typing.Tuple`\\ [()] " ),
235+ (Tuple [()], ":py:data:`~typing.Tuple`" ),
236236 # Internal single tuple with simple types is flattened in the output
237237 (Tuple [(int ,)], ":py:data:`~typing.Tuple`\\ [:py:class:`int`]" ),
238238 (Tuple [(int , int )], ":py:data:`~typing.Tuple`\\ [:py:class:`int`, :py:class:`int`]" ),
@@ -374,7 +374,7 @@ def set_python_path() -> None:
374374def maybe_fix_py310 (expected_contents : str ) -> str :
375375 if PY310_PLUS :
376376 for old , new in [
377- ("*bool** | **None*" , '"bool" | "None" ' ),
377+ ("*bool** | **None*" , '"Optional"["bool"] ' ),
378378 ("*int** | **str** | **float*" , '"int" | "str" | "float"' ),
379379 ("*str** | **None*" , '"Optional"["str"]' ),
380380 ("(*bool*)" , '("bool")' ),
@@ -719,7 +719,8 @@ def test_sphinx_output_future_annotations(app: SphinxTestApp, status: StringIO)
719719 Return type:
720720 str
721721 """
722- assert text_contents == maybe_fix_py310 (dedent (expected_contents ))
722+ expected_contents = maybe_fix_py310 (dedent (expected_contents ))
723+ assert text_contents == expected_contents
723724
724725
725726@pytest .mark .parametrize (
0 commit comments