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:
9090
9191 pypi_data = (pypi_api / pypi_name / "json" ).get ()
9292
93- if "project_urls" in pypi_data ["info" ]:
93+ if "project_urls" in pypi_data ["info" ] and pypi_data [ "info" ][ "project_urls" ] :
9494 docs_dict = search_dict (pypi_data ["info" ]["project_urls" ], r"^[dD]oc(s|umentation)" )
9595 if docs_dict :
9696
Original file line number Diff line number Diff line change @@ -97,6 +97,9 @@ def test_get_sphinx_doc_url():
9797 assert cache .clear (get_sphinx_doc_url )
9898 assert not (cache .cache_dir / "get_sphinx_doc_url.json" ).is_file ()
9999
100+ with pytest .raises (ValueError , match = "Documentation URl not found in data from PyPI." ):
101+ get_sphinx_doc_url ("sphinx-prompt" )
102+
100103
101104def test_get_sphinx_doc_url_wrapping ():
102105 assert get_sphinx_doc_url .__name__ == "get_sphinx_doc_url"
You can’t perform that action at this time.
0 commit comments