File: test_scipy_version.py

package info (click to toggle)
python-scipy 1.1.0-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 93,828 kB
  • sloc: python: 156,854; ansic: 82,925; fortran: 80,777; cpp: 7,505; makefile: 427; sh: 294
file content (21 lines) | stat: -rw-r--r-- 672 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import division, absolute_import, print_function

import re

import scipy
from numpy.testing import assert_


def test_valid_scipy_version():
    # Verify that the scipy version is a valid one (no .post suffix or other
    # nonsense).  See numpy issue gh-6431 for an issue caused by an invalid
    # version.
    version_pattern = r"^[0-9]+\.[0-9]+\.[0-9]+(|a[0-9]|b[0-9]|rc[0-9])"
    dev_suffix = r"(\.dev0\+([0-9a-f]{7}|Unknown))"
    if scipy.version.release:
        res = re.match(version_pattern, scipy.__version__)
    else:
        res = re.match(version_pattern + dev_suffix, scipy.__version__)

    assert_(res is not None, scipy.__version__)