@@ -44,7 +44,7 @@ def test_parameter_doc() -> None:
4444 modules = {"__init__.py" : f"{ typing_imports } \n def f(a: Annotated[str, Doc('Hello.')]): ..." },
4545 extensions = Extensions (TypingDocExtension ()),
4646 ) as package :
47- assert package ["f" ].docstring .parsed [1 ].value [0 ].description == "Hello."
47+ assert package ["f" ].docstring .parsed [0 ].value [0 ].description == "Hello."
4848
4949
5050def test_other_parameter_doc () -> None :
@@ -63,7 +63,7 @@ def f(**kwargs: Annotated[Unpack[OtherParameters], Doc("See other parameters.")]
6363 },
6464 extensions = Extensions (TypingDocExtension ()),
6565 ) as package :
66- assert package ["f" ].docstring .parsed [2 ].value [0 ].description == "Hello."
66+ assert package ["f" ].docstring .parsed [0 ].value [0 ].description == "Hello."
6767
6868
6969def test_iterator_doc () -> None :
@@ -79,7 +79,7 @@ def f() -> Iterator[Annotated[int, Doc("Yielded hello.")]]:
7979 },
8080 extensions = Extensions (TypingDocExtension ()),
8181 ) as package :
82- assert package ["f" ].docstring .parsed [1 ].value [0 ].description == "Yielded hello."
82+ assert package ["f" ].docstring .parsed [0 ].value [0 ].description == "Yielded hello."
8383
8484
8585def test_generator_doc () -> None :
@@ -100,9 +100,9 @@ def f() -> Generator[
100100 extensions = Extensions (TypingDocExtension ()),
101101 ) as package :
102102 sections = package ["f" ].docstring .parsed
103- assert sections [1 ].value [0 ].description == "Yielded hello."
104- assert sections [2 ].value [0 ].description == "Received hello."
105- assert sections [3 ].value [0 ].description == "Returned hello."
103+ assert sections [0 ].value [0 ].description == "Yielded hello."
104+ assert sections [1 ].value [0 ].description == "Received hello."
105+ assert sections [2 ].value [0 ].description == "Returned hello."
106106
107107
108108def test_generator_tuples () -> None :
@@ -132,12 +132,12 @@ def f() -> Generator[
132132 extensions = Extensions (TypingDocExtension ()),
133133 ) as package :
134134 sections = package ["f" ].docstring .parsed
135- assert sections [1 ].value [0 ].description == "First yielded."
136- assert sections [1 ].value [1 ].description == "Second yielded."
137- assert sections [2 ].value [0 ].description == "First received."
138- assert sections [2 ].value [1 ].description == "Second received."
139- assert sections [3 ].value [0 ].description == "First returned."
140- assert sections [3 ].value [1 ].description == "Second returned."
135+ assert sections [0 ].value [0 ].description == "First yielded."
136+ assert sections [0 ].value [1 ].description == "Second yielded."
137+ assert sections [1 ].value [0 ].description == "First received."
138+ assert sections [1 ].value [1 ].description == "Second received."
139+ assert sections [2 ].value [0 ].description == "First returned."
140+ assert sections [2 ].value [1 ].description == "Second returned."
141141
142142
143143def test_return_doc () -> None :
@@ -147,7 +147,7 @@ def test_return_doc() -> None:
147147 modules = {"__init__.py" : f"{ typing_imports } \n def f() -> Annotated[int, Doc('Hello.')]: ..." },
148148 extensions = Extensions (TypingDocExtension ()),
149149 ) as package :
150- assert package ["f" ].docstring .parsed [1 ].value [0 ].description == "Hello."
150+ assert package ["f" ].docstring .parsed [0 ].value [0 ].description == "Hello."
151151
152152
153153def test_unpacking_typed_dict () -> None :
0 commit comments