~inkscape.dev/inkscape-devlibs64/trunk

« back to all changes in this revision

Viewing changes to python/Lib/site-packages/numpy/tests/test_numpy_version.py

  • Committer: Eduard Braun
  • Date: 2016-10-22 16:51:19 UTC
  • Revision ID: eduard.braun2@gmx.de-20161022165119-9eosgy6lp8j1kzli
Update Python to version 2.7.12

Included modules:
  coverage 4.2
  lxml 3.6.4
  numpy 1.11.2
  scour 0.35
  six 1.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import division, absolute_import, print_function
 
2
 
 
3
import re
 
4
 
 
5
import numpy as np
 
6
from numpy.testing import assert_, run_module_suite
 
7
 
 
8
 
 
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__)
 
16
    else:
 
17
        res = re.match(version_pattern + dev_suffix, np.__version__)
 
18
 
 
19
    assert_(res is not None, np.__version__)
 
20
 
 
21
 
 
22
if __name__ == "__main__":
 
23
    run_module_suite()