Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0cb6e3b

Browse files
committed
Fix and restore tests in test_numpy_version.py
[skip cirrus] [skip azp]
1 parent 32eec14 commit 0cb6e3b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

numpy/tests/test_numpy_version.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,17 @@ def test_valid_numpy_version():
2525
# Verify that the numpy version is a valid one (no .post suffix or other
2626
# nonsense). See gh-6431 for an issue caused by an invalid version.
2727
version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(a[0-9]|b[0-9]|rc[0-9])?"
28-
dev_suffix = r"(dev[0-9]+\+git[0-9]+\.[0-9a-f]+)?"
28+
dev_suffix = r"(\.dev[0-9]+\+git[0-9]+\.[0-9a-f]+)?"
2929
res = re.match(version_pattern + dev_suffix + '$', np.__version__)
3030

3131
assert_(res is not None, np.__version__)
32+
33+
34+
def test_short_version():
35+
# Check numpy.short_version actually exists
36+
if np.version.release:
37+
assert_(np.__version__ == np.version.short_version,
38+
"short_version mismatch in release version")
39+
else:
40+
assert_(np.__version__.split("+")[0] == np.version.short_version,
41+
"short_version mismatch in development version")

0 commit comments

Comments
 (0)