forked from aernlund/Numpy-Tutorial-SciPyConf-2016
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_env.py
More file actions
29 lines (19 loc) · 633 Bytes
/
Copy pathcheck_env.py
File metadata and controls
29 lines (19 loc) · 633 Bytes
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
""" Run this file to check your python installation.
"""
from numpy.testing import assert_array_equal
def test_import_numpy():
import numpy
def test_numpy_version():
import numpy
version_found = numpy.__version__.split(".")
version_found = tuple(int(num) for num in version_found)
assert version_found > (1, 8)
def test_import_matplotlib():
from matplotlib.pyplot import plot
def test_slicing():
from numpy import array
x = array([[1, 2, 3], [4, 5, 6]])
assert_array_equal(x[:, ::2], array([[1, 3], [4, 6]]))
if __name__ == "__main__":
import nose
nose.run(defaultTest=__name__)