Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/f2py/tests/test_kind.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 from numpy.testing import * | |
7 from numpy import array | |
8 | |
9 import util | |
10 | |
11 def _path(*a): | |
12 return os.path.join(*((os.path.dirname(__file__),) + a)) | |
13 | |
14 from numpy.f2py.crackfortran import _selected_int_kind_func as selected_int_kind | |
15 from numpy.f2py.crackfortran import _selected_real_kind_func as selected_real_kind | |
16 | |
17 class TestKind(util.F2PyTest): | |
18 sources = [_path('src', 'kind', 'foo.f90'), | |
19 ] | |
20 | |
21 @dec.slow | |
22 def test_all(self): | |
23 selectedrealkind = self.module.selectedrealkind | |
24 selectedintkind = self.module.selectedintkind | |
25 | |
26 for i in range(40): | |
27 assert_(selectedintkind(i) in [selected_int_kind(i), -1],\ | |
28 'selectedintkind(%s): expected %r but got %r' % (i, selected_int_kind(i), selectedintkind(i))) | |
29 | |
30 for i in range(20): | |
31 assert_(selectedrealkind(i) in [selected_real_kind(i), -1],\ | |
32 'selectedrealkind(%s): expected %r but got %r' % (i, selected_real_kind(i), selectedrealkind(i))) | |
33 | |
34 if __name__ == "__main__": | |
35 import nose | |
36 nose.runmodule() |