File: test_import_cycles.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 (52 lines) | stat: -rw-r--r-- 1,284 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from __future__ import division, print_function, absolute_import

import sys
import subprocess


MODULES = [
    "scipy.cluster",
    "scipy.cluster.vq",
    "scipy.cluster.hierarchy",
    "scipy.constants",
    "scipy.fftpack",
    "scipy.integrate",
    "scipy.interpolate",
    "scipy.io",
    "scipy.io.arff",
    "scipy.io.harwell_boeing",
    "scipy.io.idl",
    "scipy.io.matlab",
    "scipy.io.netcdf",
    "scipy.io.wavfile",
    "scipy.linalg",
    "scipy.linalg.blas",
    "scipy.linalg.cython_blas",
    "scipy.linalg.lapack",
    "scipy.linalg.cython_lapack",
    "scipy.linalg.interpolative",
    "scipy.misc",
    "scipy.ndimage",
    "scipy.odr",
    "scipy.optimize",
    "scipy.signal",
    "scipy.signal.windows",
    "scipy.sparse",
    "scipy.sparse.linalg",
    "scipy.sparse.csgraph",
    "scipy.spatial",
    "scipy.spatial.distance",
    "scipy.special",
    "scipy.stats",
    "scipy.stats.distributions",
    "scipy.stats.mstats",
]


def test_modules_importable():
    # Check that all modules are importable in a new Python
    # process. This is not necessarily true (esp on Python 2) if there
    # are import cycles present.
    for module in MODULES:
        cmd = 'import {}'.format(module)
        subprocess.check_call([sys.executable, '-c', cmd])