Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/f2py/tests/test_regression.py @ 87:2a2c65a20a8b
Add Python libs and headers
author | Chris Cannam |
---|---|
date | Wed, 25 Feb 2015 14:05:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
86:413a9d26189e | 87:2a2c65a20a8b |
---|---|
1 from __future__ import division, absolute_import, print_function | |
2 | |
3 import os | |
4 import math | |
5 | |
6 import numpy as np | |
7 from numpy.testing import dec, assert_raises, assert_equal | |
8 | |
9 import util | |
10 | |
11 def _path(*a): | |
12 return os.path.join(*((os.path.dirname(__file__),) + a)) | |
13 | |
14 class TestIntentInOut(util.F2PyTest): | |
15 # Check that intent(in out) translates as intent(inout) | |
16 sources = [_path('src', 'regression', 'inout.f90')] | |
17 | |
18 @dec.slow | |
19 def test_inout(self): | |
20 # non-contiguous should raise error | |
21 x = np.arange(6, dtype=np.float32)[::2] | |
22 assert_raises(ValueError, self.module.foo, x) | |
23 | |
24 # check values with contiguous array | |
25 x = np.arange(3, dtype=np.float32) | |
26 self.module.foo(x) | |
27 assert_equal(x, [3, 1, 2]) | |
28 | |
29 | |
30 if __name__ == "__main__": | |
31 import nose | |
32 nose.runmodule() |