1
from __future__ import division, absolute_import, print_function
6
from numpy.testing import assert_, run_module_suite
9
def test_valid_numpy_version():
10
# Verify that the numpy version is a valid one (no .post suffix or other
11
# nonsense). See gh-6431 for an issue caused by an invalid version.
12
version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(|a[0-9]|b[0-9]|rc[0-9])"
13
dev_suffix = r"(\.dev0\+([0-9a-f]{7}|Unknown))"
14
if np.version.release:
15
res = re.match(version_pattern, np.__version__)
17
res = re.match(version_pattern + dev_suffix, np.__version__)
19
assert_(res is not None, np.__version__)
22
if __name__ == "__main__":