File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ def get_sphinx_doc_url(pypi_name: str) -> str:
90
90
91
91
pypi_data = (pypi_api / pypi_name / "json" ).get ()
92
92
93
- if "project_urls" in pypi_data ["info" ]:
93
+ if "project_urls" in pypi_data ["info" ] and pypi_data [ "info" ][ "project_urls" ] :
94
94
docs_dict = search_dict (pypi_data ["info" ]["project_urls" ], r"^[dD]oc(s|umentation)" )
95
95
if docs_dict :
96
96
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ def test_get_sphinx_doc_url():
97
97
assert cache .clear (get_sphinx_doc_url )
98
98
assert not (cache .cache_dir / "get_sphinx_doc_url.json" ).is_file ()
99
99
100
+ with pytest .raises (ValueError , match = "Documentation URl not found in data from PyPI." ):
101
+ get_sphinx_doc_url ("sphinx-prompt" )
102
+
100
103
101
104
def test_get_sphinx_doc_url_wrapping ():
102
105
assert get_sphinx_doc_url .__name__ == "get_sphinx_doc_url"
You can’t perform that action at this time.
0 commit comments