Skip to content

Commit 4c4792e

Browse files
committed
Update numpy test for the latest numpy version.
1 parent 07e89a1 commit 4c4792e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_core.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# stdlib
22
import re
3+
import sys
34
from typing import get_type_hints
45

56
# 3rd party
@@ -32,7 +33,12 @@ def test_get_sphinx_doc_url():
3233
with pytest.raises(ValueError, match="Documentation URL not found in data from PyPI."):
3334
get_sphinx_doc_url("sphinx-prompt")
3435

35-
assert re.match(r"https://numpy\.org/doc/1\.\d\d/", get_sphinx_doc_url("numpy"))
36+
if sys.version_info < (3, 8):
37+
# Latest numpy's "Documentation" url doesn't point to Sphinx docs.
38+
with pytest.raises(ValueError):
39+
get_sphinx_doc_url("numpy")
40+
else:
41+
assert re.match(r"https://numpy\.org/doc/1\.\d\d/", get_sphinx_doc_url("numpy"))
3642

3743
assert get_sphinx_doc_url("matplotlib") == "https://matplotlib.org/"
3844

0 commit comments

Comments
 (0)