11# stdlib
22import ast
3- from typing import Set
3+ from typing import Any , Set
44
55# 3rd party
66import pytest
@@ -14,7 +14,7 @@ def results(s: str) -> Set[str]:
1414
1515
1616@pytest .mark .parametrize ("obj" , py_obj )
17- def test_bad_docstring_py_obj (obj ):
17+ def test_bad_docstring_py_obj (obj : Any ):
1818 test_code = f'''"""
1919
2020``{ obj } ``
@@ -41,12 +41,8 @@ def good_docstring():
4141
4242'''
4343
44- assert results (test_code
45- ) == { # noqa: sphinx_links001
46- f"3:0: { SXL001 } " ,
47- f"8:0: { SXL001 } " ,
48- f"13:1: { SXL001 } " ,
49- }
44+ expected_results = {f"3:0: { SXL001 } " , f"8:0: { SXL001 } " , f"13:1: { SXL001 } " }
45+ assert results (test_code ) == expected_results
5046
5147
5248@pytest .mark .parametrize ("obj" , py_obj_python )
@@ -77,16 +73,12 @@ class good_docstring():
7773
7874'''
7975
80- assert results (test_code
81- ) == { # noqa: sphinx_links001
82- f"3:0: { SXL001 } " ,
83- f"8:0: { SXL001 } " ,
84- f"13:1: { SXL001 } " ,
85- }
76+ expected_results = {f"3:0: { SXL001 } " , f"8:0: { SXL001 } " , f"13:1: { SXL001 } " }
77+ assert results (test_code ) == expected_results
8678
8779
8880@pytest .mark .parametrize ("obj" , exc )
89- def test_bad_docstring_exc (obj ):
81+ def test_bad_docstring_exc (obj : Any ):
9082 test_code = f'''"""
9183
9284``{ obj } ``
@@ -111,12 +103,8 @@ class good_docstring():
111103
112104'''
113105
114- assert results (test_code
115- ) == { # noqa: sphinx_links001
116- f"3:0: { SXL001 } " ,
117- f"8:0: { SXL001 } " ,
118- f"12:0: { SXL001 } " ,
119- }
106+ expected_results = {f"3:0: { SXL001 } " , f"8:0: { SXL001 } " , f"12:0: { SXL001 } " }
107+ assert results (test_code ) == expected_results
120108
121109
122110@pytest .mark .parametrize ("obj" , class_ )
@@ -145,9 +133,5 @@ class good_docstring():
145133
146134'''
147135
148- assert results (test_code
149- ) == { # noqa: sphinx_links001
150- f"3:0: { SXL001 } " ,
151- f"8:0: { SXL001 } " ,
152- f"13:1: { SXL001 } " ,
153- }
136+ expected_results = {f"3:0: { SXL001 } " , f"8:0: { SXL001 } " , f"13:1: { SXL001 } " }
137+ assert results (test_code ) == expected_results
0 commit comments